Ensure that the uncommon __unloadNode codepath does not unintentionally trigger node removal.

This commit is contained in:
Scott Goodson
2015-12-29 23:11:33 -08:00
parent 95e28d6c11
commit df3ce787f7
4 changed files with 31 additions and 3 deletions

View File

@@ -352,8 +352,9 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
- (void)__unloadNode
{
ASDisplayNodeAssertThreadAffinity(self);
ASDisplayNodeAssert([self isNodeLoaded], @"Implementation shouldn't call __unloadNode if not loaded: %@", self);
ASDN::MutexLocker l(_propertyLock);
if (_flags.layerBacked)
_pendingViewState = [_ASPendingState pendingViewStateFromLayer:_layer];
else