Create pending nodes set lazily

This commit is contained in:
Ian Cloutier 2015-05-23 12:04:58 -04:00
parent b9597ff96b
commit 45f719fc6c

View File

@ -116,8 +116,6 @@ void ASDisplayNodePerformBlockOnMainThread(void (^block)())
_contentsScaleForDisplay = ASDisplayNodeScreenScale();
_displaySentinel = [[ASSentinel alloc] init];
_pendingDisplayNodes = [[NSMutableSet alloc] init];
_flags.isInHierarchy = NO;
_flags.displaysAsynchronously = YES;
@ -1218,6 +1216,10 @@ static NSInteger incrementIfFound(NSInteger i) {
{
ASDN::MutexLocker l(_propertyLock);
if (!_pendingDisplayNodes) {
_pendingDisplayNodes = [[NSMutableSet alloc] init];
}
[_pendingDisplayNodes addObject:node];
}