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
+9 -14
View File
@@ -204,30 +204,25 @@ Phaser.BitmapText.prototype.postUpdate = function () {
*/
Phaser.BitmapText.prototype.destroy = function() {
if (this.filters)
{
this.filters = null;
}
if (this.parent)
{
this.parent.remove(this);
}
var i = this.children.length;
while (i--)
{
this.removeChild(this.children[i]);
}
this.exists = false;
this.visible = false;
this.filters = null;
this.mask = null;
this.game = null;
if (this.children.length > 0)
{
do
{
this.removeChild(this.children[0]);
}
while (this.children.length > 0);
}
}
/**