mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Merge pull request #1438 from Adlai-Holler/AvoidMutatingSublayersAgain
[ASDisplayNode] Copy Sublayers in recursivelyTriggerDisplayForLayer to Avoid NSFastEnumerationMutation Exception
This commit is contained in:
@@ -1892,7 +1892,8 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
|
||||
}
|
||||
|
||||
// Kick off the recursion first, so that all necessary display calls are sent and the displayQueue is full of parallelizable work.
|
||||
for (CALayer *sublayer in layer.sublayers) {
|
||||
// NOTE: The docs report that `sublayers` returns a copy but it actually doesn't.
|
||||
for (CALayer *sublayer in [layer.sublayers copy]) {
|
||||
recursivelyTriggerDisplayForLayer(sublayer, shouldBlock);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user