Skip to content

Commit 6d7ca32

Browse files
committed
Game Objects would not remove themselves from the Scene's shutdown event handler when destroyed, leading to a build-up over time
1 parent 0436f1f commit 6d7ca32

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ This change has been introduced for `pointerdown`, `pointerup`, `pointermove`, `
6464
* Calling `Text.setStyle` would make the Text vanish if you didn't provide a `resolution` property in the style configuration object. Calling `setStyle` now only changes the properties given in the object, leaving any previously changed properties as-is. Fix #4011 (thanks @okcompewter)
6565
* In Matter.js if a body had its debug `render.visible` property set to `false` it wouldn't then render any other debug body beyond it. Now it will just skip bodies with hidden debug graphics (thanks @jf908)
6666
* If you flagged a Tween as `paused` in its config, never started it, and then called `Tween.stop` it wouldn't ever be removed from the `_pending` array. It's now moved to the Tween Manager's destroy list, ready for removal on the next frame. Fix #4023 (thanks @goldfire)
67+
* Game Objects would not remove themselves from the Scene's `shutdown` event handler when destroyed, leading to a build-up over time (thanks @goldfire)
6768

6869
### Examples, Documentation and TypeScript
6970

src/gameobjects/GameObject.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,8 @@ var GameObject = new Class({
561561
// Tell the Scene to re-sort the children
562562
sys.queueDepthSort();
563563

564+
sys.events.off('shutdown', this.destroy, this);
565+
564566
this.active = false;
565567
this.visible = false;
566568

0 commit comments

Comments
 (0)