mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-19 04:39:36 +00:00
Need to trampoline to main to make contents check safe if nodes are loaded. (#2545)
This commit is contained in:
parent
62a0296148
commit
11e07ff409
@ -1143,7 +1143,15 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
|
||||
[self setCalculatedDisplayNodeLayout:_pendingLayoutTransition.pendingLayout];
|
||||
[self _completeLayoutTransition:_pendingLayoutTransition];
|
||||
}
|
||||
[self _pendingLayoutTransitionDidComplete];
|
||||
|
||||
// Trampoline to the main thread if necessary
|
||||
if (_pendingLayoutTransition && _pendingLayoutTransition.isSynchronous == NO) {
|
||||
[self _pendingLayoutTransitionDidComplete];
|
||||
} else {
|
||||
ASPerformBlockOnMainThread(^{
|
||||
[self _pendingLayoutTransitionDidComplete];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1158,7 +1166,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
|
||||
}
|
||||
|
||||
// Trampoline to the main thread if necessary
|
||||
if (ASDisplayNodeThreadIsMain() || layoutTransition.isSynchronous == NO) {
|
||||
if (layoutTransition.isSynchronous == NO) {
|
||||
[layoutTransition commitTransition];
|
||||
} else {
|
||||
// Subnode insertions and removals need to happen always on the main thread if at least one subnode is already loaded
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user