[ASInterfaceState] Fix for an edge case of exiting Visible state before node deallocation.

This commit is contained in:
Scott Goodson 2016-03-27 18:15:40 -07:00
parent 97798010cb
commit 3e2414da6f

View File

@ -90,6 +90,11 @@
self.keepalive_node = _node;
}
else if (currentSuperview && !newSuperview) {
// Clearing keepalive_node may cause deallocation of the node. In this case, __exitHierarchy may not have an opportunity (e.g. _node will be cleared
// by the time -didMoveToWindow occurs after this) to clear the Visible interfaceState, which we need to do before deallocation to meet an API guarantee.
if (_node.inHierarchy) {
[_node __exitHierarchy];
}
self.keepalive_node = nil;
}