Skip to content

Commit

Permalink
Make sure _locked_constrainedSizeForLayoutPass is called with the loc…
Browse files Browse the repository at this point in the history
…k held (#488)
  • Loading branch information
nguyenhuy committed Aug 4, 2017
1 parent 27abc77 commit 3c6b836
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/ASDisplayNode+Layout.mm
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,14 @@ - (void)transitionLayoutWithAnimation:(BOOL)animated
measurementCompletion:(void(^)())completion
{
ASDisplayNodeAssertMainThread();
[self transitionLayoutWithSizeRange:[self _locked_constrainedSizeForLayoutPass]

ASSizeRange sizeRange;
{
ASDN::MutexLocker l(__instanceLock__);
sizeRange = [self _locked_constrainedSizeForLayoutPass];
}

[self transitionLayoutWithSizeRange:sizeRange
animated:animated
shouldMeasureAsync:shouldMeasureAsync
measurementCompletion:completion];
Expand Down

0 comments on commit 3c6b836

Please sign in to comment.