onFrame crashes

15 views
Skip to first unread message

Jose Antonio Rodrigues

unread,
Nov 23, 2023, 8:29:58 AM11/23/23
to Paper.js
I have a project that contains a lot of animations using `onFrame`.  To reset my animations I would simply call the `layer.remove()` on the layer I want to reset.  I noticed that after a few times of resetting my animations all the `onFrame `functions would stop working.  I figured `onFrame `was crashing due to some sort of memory overload.

I managed to fix the problem by calling `layer.removeChildren()` prior to `layer.remove()`.

I see that `.remove()` does not destroy the item, but wouldn't `.removeChildren()` apply the same logic but just to the layers children. Is this a bug or is it intended?
Reply all
Reply to author
Forward
0 new messages