mirror of
https://github.com/photonstorm/phaser
synced 2024-11-15 01:17:43 +00:00
Merge pull request #4646 from rexrainbow/master
Remove event hook of children when destroyChildren is false
This commit is contained in:
commit
9dcff3b0fb
1 changed files with 1 additions and 16 deletions
|
@ -1134,22 +1134,7 @@ var Group = new Class({
|
|||
return;
|
||||
}
|
||||
|
||||
if (destroyChildren)
|
||||
{
|
||||
var children = this.children;
|
||||
|
||||
for (var i = 0; i < children.size; i++)
|
||||
{
|
||||
var gameObject = children.entries[i];
|
||||
|
||||
// Remove the event hook first or it'll go all recursive hell on us
|
||||
gameObject.off(Events.DESTROY, this.remove, this);
|
||||
|
||||
gameObject.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
this.children.clear();
|
||||
this.clear(false, destroyChildren);
|
||||
|
||||
this.scene = undefined;
|
||||
this.children = undefined;
|
||||
|
|
Loading…
Reference in a new issue