Skip to content

Commit 7134a1e

Browse files
committed
Remove event hook of children when destroyChildren is false
1 parent 4f87c7d commit 7134a1e

1 file changed

Lines changed: 1 addition & 16 deletions

File tree

src/gameobjects/group/Group.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,22 +1134,7 @@ var Group = new Class({
11341134
return;
11351135
}
11361136

1137-
if (destroyChildren)
1138-
{
1139-
var children = this.children;
1140-
1141-
for (var i = 0; i < children.size; i++)
1142-
{
1143-
var gameObject = children.entries[i];
1144-
1145-
// Remove the event hook first or it'll go all recursive hell on us
1146-
gameObject.off(Events.DESTROY, this.remove, this);
1147-
1148-
gameObject.destroy();
1149-
}
1150-
}
1151-
1152-
this.children.clear();
1137+
this.clear(false, destroyChildren);
11531138

11541139
this.scene = undefined;
11551140
this.children = undefined;

0 commit comments

Comments
 (0)