Skip to content

Commit

Permalink
Improve thread-safety of ASDisplayNode's didExitHierarchy #trivial (#916
Browse files Browse the repository at this point in the history
)

Since `didExitHierarchy` is called without the node's instance lock being held, the lock must be acquired before accessing `pendingInterfaceState`.
  • Loading branch information
nguyenhuy authored May 11, 2018
1 parent 3981f17 commit 970ebd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3016,7 +3016,7 @@ - (void)didExitHierarchy
return;
}
#endif
if (ASInterfaceStateIncludesVisible(_pendingInterfaceState)) {
if (ASInterfaceStateIncludesVisible(self.pendingInterfaceState)) {
void(^exitVisibleInterfaceState)(void) = ^{
// This block intentionally retains self.
__instanceLock__.lock();
Expand Down

0 comments on commit 970ebd9

Please sign in to comment.