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

Commit 8801b61

Browse files
committed
Merge pull request #1438 from Adlai-Holler/AvoidMutatingSublayersAgain
[ASDisplayNode] Copy Sublayers in recursivelyTriggerDisplayForLayer to Avoid NSFastEnumerationMutation Exception
2 parents c9b448b + f205a6c commit 8801b61

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

AsyncDisplayKit/ASDisplayNode.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,8 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
18921892
}
18931893

18941894
// Kick off the recursion first, so that all necessary display calls are sent and the displayQueue is full of parallelizable work.
1895-
for (CALayer *sublayer in layer.sublayers) {
1895+
// NOTE: The docs report that `sublayers` returns a copy but it actually doesn't.
1896+
for (CALayer *sublayer in [layer.sublayers copy]) {
18961897
recursivelyTriggerDisplayForLayer(sublayer, shouldBlock);
18971898
}
18981899

0 commit comments

Comments
 (0)