Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 17bd3ac

Browse files
committed
Revert "Need to trampoline to main to make contents check safe if nodes are loaded. (#2545)"
This reverts commit 11e07ff.
1 parent d7ba0a9 commit 17bd3ac

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

AsyncDisplayKit/ASDisplayNode.mm

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,15 +1143,7 @@ - (void)_completePendingLayoutTransition
11431143
[self setCalculatedDisplayNodeLayout:_pendingLayoutTransition.pendingLayout];
11441144
[self _completeLayoutTransition:_pendingLayoutTransition];
11451145
}
1146-
1147-
// Trampoline to the main thread if necessary
1148-
if (_pendingLayoutTransition && _pendingLayoutTransition.isSynchronous == NO) {
1149-
[self _pendingLayoutTransitionDidComplete];
1150-
} else {
1151-
ASPerformBlockOnMainThread(^{
1152-
[self _pendingLayoutTransitionDidComplete];
1153-
});
1154-
}
1146+
[self _pendingLayoutTransitionDidComplete];
11551147
}
11561148

11571149
/*
@@ -1166,7 +1158,7 @@ - (void)_completeLayoutTransition:(ASLayoutTransition *)layoutTransition
11661158
}
11671159

11681160
// Trampoline to the main thread if necessary
1169-
if (layoutTransition.isSynchronous == NO) {
1161+
if (ASDisplayNodeThreadIsMain() || layoutTransition.isSynchronous == NO) {
11701162
[layoutTransition commitTransition];
11711163
} else {
11721164
// Subnode insertions and removals need to happen always on the main thread if at least one subnode is already loaded
@@ -1194,7 +1186,7 @@ - (void)_pendingLayoutTransitionDidComplete
11941186
if (CGSizeEqualToSize(layoutSize, CGSizeZero)) {
11951187
return;
11961188
}
1197-
1189+
11981190
if (!_placeholderImage) {
11991191
_placeholderImage = [self placeholderImage];
12001192
}

0 commit comments

Comments
 (0)