-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Destroying a group with a sprite containing an animation on the onComplete signal causes a JS error. #1679
Comments
It sprite doesn't keep running. The problem is group.destroy triggers a destroy of the animation from within the The setInterval (of any amount) delays the side-effects until later. |
There is a patch for the issue. In the meantime the best work-about is probably to keep using YMMV with destroying objects from other events. |
Fix merged in dev. |
Downloaded Tarabon yesterday, the bug still occurs. But setTimeout seems to work just fine. |
@trueicecold Make sure to build locally (and not just a build pulled from git) when testing these 'latest and greatest' in dev. If you can still reproduce it on dev, please create a minimal test case and I'll take look at it. There are several different scenarios to guard and it is very possible that one is missed. In my local tests I was able to destroy the sprite/animation/group from within the onXYZ events of the animation. |
Bug still active |
Example code:
causes a JS error:
Note: delaying the "group destroy" by using setTimeout seems to fix it, but it's not a proper solution...
My guess is that the animation keeps running for a couple more frames even when the onComplete signal was sent?
Using Phaser 2.2.2
The text was updated successfully, but these errors were encountered: