Improve thread-safety of ASDisplayNode's didExitHierarchy #trivial (#916)

Since `didExitHierarchy` is called without the node's instance lock being held, the lock must be acquired before accessing `pendingInterfaceState`.
This commit is contained in:
Huy Nguyen
2018-05-11 17:26:00 +01:00
committed by GitHub
parent 3981f1724e
commit 970ebd987e

View File

@@ -3016,7 +3016,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) {
return;
}
#endif
if (ASInterfaceStateIncludesVisible(_pendingInterfaceState)) {
if (ASInterfaceStateIncludesVisible(self.pendingInterfaceState)) {
void(^exitVisibleInterfaceState)(void) = ^{
// This block intentionally retains self.
__instanceLock__.lock();