Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If an Animation's on_stop handler cleared itself inside the on_stop event handler, it would remove itself from the animation map that was still being iterated, leading to a crash. To solve this, we'll iterate over the animations using the remove_all_matching function, which enables us to delete it by simply returning true when the animation finished. In the event that the Animation is kept alive elsewhere and the on_stop event clears its own reference, we need to temporarily bump the reference count. Another advantage is that we only need to bump the reference count when an animation is finished, whereas before this we bumped it unconditionally.
- Loading branch information