Skip to content

Commit e94d925

Browse files
committed
GameObjects added to and removed from Containers no longer listen for the shutdown event at all
1 parent c704dc4 commit e94d925

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Bug Fixes
1010

11+
* GameObjects added to and removed from Containers no longer listen for the `shutdown` event at all (thanks Vitali)
12+
1113
### Examples, Documentation and TypeScript
1214

1315
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:

src/gameobjects/container/Container.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,6 @@ var Container = new Class({
376376

377377
gameObject.parentContainer = this;
378378
}
379-
380-
// Game Objects automatically listen to the Scene shutdown event, but
381-
// we don't need this if they're in a Container
382-
this._sysEvents.off('shutdown', gameObject.destroy, gameObject);
383379
},
384380

385381
/**
@@ -398,8 +394,6 @@ var Container = new Class({
398394
if (this.exclusive)
399395
{
400396
gameObject.parentContainer = null;
401-
402-
this._sysEvents.once('shutdown', gameObject.destroy, gameObject);
403397
}
404398
},
405399

0 commit comments

Comments
 (0)