Revert "Fix if pending layout will be deallocated (#2038)" (#2051)

This reverts commit 2804d50220dabebc62b088b17d5ffe2347da1e36.
This commit is contained in:
Adlai Holler 2016-08-09 16:10:21 -07:00 committed by GitHub
parent 893e601e81
commit 49b65fd783

View File

@ -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