From 970ebd987e65be3ffa34c424da35886aadb4e99a Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Fri, 11 May 2018 17:26:00 +0100 Subject: [PATCH] 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`. --- Source/ASDisplayNode.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index aa1497ac1..ed8f4a421 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -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();