From 49b65fd783df1b86ea7e87b9f42293cc85f6fe14 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Tue, 9 Aug 2016 16:10:21 -0700 Subject: [PATCH] Revert "Fix if pending layout will be deallocated (#2038)" (#2051) This reverts commit 2804d50220dabebc62b088b17d5ffe2347da1e36. --- AsyncDisplayKit/ASDisplayNode.mm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/AsyncDisplayKit/ASDisplayNode.mm b/AsyncDisplayKit/ASDisplayNode.mm index c57589025d..edbf245461 100644 --- a/AsyncDisplayKit/ASDisplayNode.mm +++ b/AsyncDisplayKit/ASDisplayNode.mm @@ -789,12 +789,9 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) } // Setup pending layout transition for animation - // The pending layout transition needs to stay alive at least until applySubnodeInsertions did finish execute as - // it can happen that with Implicit Hierarchy Management new nodes gonna be added that internally call setNeedsLayout - // what will invalidate and deallocate the transition in the middle of inserting nodes - NS_VALID_UNTIL_END_OF_SCOPE ASLayoutTransition *pendingLayoutTransition = [[ASLayoutTransition alloc] initWithNode:self pendingLayout:newLayout previousLayout:previousLayout]; - _pendingLayoutTransition = pendingLayoutTransition; - + _pendingLayoutTransition = [[ASLayoutTransition alloc] initWithNode:self + pendingLayout:newLayout + previousLayout:previousLayout]; // Setup context for pending layout transition. we need to hold a strong reference to the context _pendingLayoutTransitionContext = [[_ASTransitionContext alloc] initWithAnimation:animated layoutDelegate:_pendingLayoutTransition