From efd760479d7cb7310f13282834982e3141e68b53 Mon Sep 17 00:00:00 2001 From: photonstorm Date: Fri, 21 Feb 2014 12:18:23 +0000 Subject: [PATCH] Sprite and Image now remove any masks that may have been set when they are destroyed. --- src/gameobjects/Image.js | 7 ++----- src/gameobjects/Sprite.js | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/gameobjects/Image.js b/src/gameobjects/Image.js index 65679081..2e6d7ee4 100644 --- a/src/gameobjects/Image.js +++ b/src/gameobjects/Image.js @@ -369,11 +369,6 @@ Phaser.Image.prototype.kill = function() { */ Phaser.Image.prototype.destroy = function() { - if (this.filters) - { - this.filters = null; - } - if (this.parent) { this.parent.remove(this); @@ -393,6 +388,8 @@ Phaser.Image.prototype.destroy = function() { this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; } diff --git a/src/gameobjects/Sprite.js b/src/gameobjects/Sprite.js index 232c94ef..9e260810 100644 --- a/src/gameobjects/Sprite.js +++ b/src/gameobjects/Sprite.js @@ -491,11 +491,6 @@ Phaser.Sprite.prototype.kill = function() { */ Phaser.Sprite.prototype.destroy = function() { - if (this.filters) - { - this.filters = null; - } - if (this.parent) { this.parent.remove(this); @@ -525,6 +520,8 @@ Phaser.Sprite.prototype.destroy = function() { this.exists = false; this.visible = false; + this.filters = null; + this.mask = null; this.game = null; };