Vitali Posted September 21, 2018 Share Posted September 21, 2018 https://github.com/photonstorm/phaser/pull/4024#event-1841241172 https://github.com/photonstorm/phaser/issues/4051 I tried Phaser 3.13 to resolve the issue with 'shutdown' listeners memory leaks, but it's like a magic - the objects appear in 'shutdown' array even in the 3.13 version! Another similar problem is 'remove' listeners stays in AnimationManager after destroying the Sprite or restarting the whole scene, it also causes memory leaks. What am I doing wrong? Link to comment Share on other sites More sharing options...
rich Posted September 21, 2018 Share Posted September 21, 2018 https://github.com/photonstorm/phaser/commit/0a166f944f23f4ad05100106d2323eb152f2bbde They absolutely don't add themselves to the shutdown event any longer. This is a Scene in 3.13 with 91 Images on the display list: and here is the same Scene in 3.12: The shutdown event has 91 less entries in it in 3.13, exactly as it should do. Link to comment Share on other sites More sharing options...
Vitali Posted September 21, 2018 Author Share Posted September 21, 2018 Thanks for the answer! You're right about the 'shutdown' listener. I've checked this, but my work project says the opposite. And I've found the source of bug. Could you try to create a Container with a Sprite inside, and then invoke destroy() on the Container or Sprite? This is the magic which I talked about, Sprite (and I think all other GameObject's inside the Container) appears inside the shutdown array! And I can't understand the Animation behaviour. The Animations have destroy() method with "this.animationManager.off('remove', this.destroy, this, true)", but when I'm trying to debug this code while I'm destroying the Sprite, this method never invokes. Link to comment Share on other sites More sharing options...
Vitali Posted September 21, 2018 Author Share Posted September 21, 2018 "shutdown" subscribing happens right there! Link to comment Share on other sites More sharing options...
rich Posted September 25, 2018 Share Posted September 25, 2018 This is now fixed in the master branch. Link to comment Share on other sites More sharing options...
Recommended Posts