[ASDisplayNode] Adjust displayNodeRecursiveDescription to avoid touching .layer off main

See this issue for a backtrace: https://github.com/TextureGroup/Texture/issues/240
This commit is contained in:
Scott Goodson
2017-05-04 22:26:48 -07:00
parent 17d956493a
commit e6fe563273
+7 -5
View File
@@ -3934,11 +3934,13 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) {
[result addObject:@{ @"alpha" : @(_pendingViewState.alpha) }];
[result addObject:@{ @"frame" : [NSValue valueWithCGRect:_pendingViewState.frame] }];
}
// Check supernode so that if we are cell node we don't find self.
ASCellNode *cellNode = ASDisplayNodeFindFirstSupernodeOfClass(self.supernode, [ASCellNode class]);
if (cellNode != nil) {
[result addObject:@{ @"cellNode" : ASObjectDescriptionMakeTiny(cellNode) }];
if (ASDisplayNodeThreadIsMain()) {
// Check supernode so that if we are cell node we don't find self.
ASCellNode *cellNode = ASDisplayNodeFindFirstSupernodeOfClass(self.supernode, [ASCellNode class]);
if (cellNode != nil) {
[result addObject:@{ @"cellNode" : ASObjectDescriptionMakeTiny(cellNode) }];
}
}
[result addObject:@{ @"interfaceState" : NSStringFromASInterfaceState(self.interfaceState)} ];