From e6fe563273db04523812eba784ba284805b4d709 Mon Sep 17 00:00:00 2001 From: Scott Goodson Date: Thu, 4 May 2017 22:26:48 -0700 Subject: [PATCH] [ASDisplayNode] Adjust displayNodeRecursiveDescription to avoid touching .layer off main See this issue for a backtrace: https://github.com/TextureGroup/Texture/issues/240 --- Source/ASDisplayNode.mm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 5e14b638..404a81cf 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -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)} ];