Display Objects now clean-up their children properly on destroy.

This commit is contained in:
photonstorm
2014-02-21 13:25:08 +00:00
parent dd8a393bc9
commit a61d030256
5 changed files with 43 additions and 20 deletions
+7
View File
@@ -384,6 +384,13 @@ Phaser.Image.prototype.destroy = function() {
this.input.destroy();
}
var i = this.children.length;
while (i--)
{
this.removeChild(this.children[i]);
}
this.alive = false;
this.exists = false;
this.visible = false;