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

Commit f205a6c

Browse files
committed
Copy sublayers in recursivelyTriggerDisplayForLayer to avoid NSFastEnumerationMutation exception
1 parent 096df7b commit f205a6c

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
@@ -1797,7 +1797,8 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
17971797
}
17981798

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

0 commit comments

Comments
 (0)