Skip to content

Commit efd7604

Browse files
committed
Sprite and Image now remove any masks that may have been set when they are destroyed.
1 parent cf3796d commit efd7604

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

src/gameobjects/Image.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,6 @@ Phaser.Image.prototype.kill = function() {
369369
*/
370370
Phaser.Image.prototype.destroy = function() {
371371

372-
if (this.filters)
373-
{
374-
this.filters = null;
375-
}
376-
377372
if (this.parent)
378373
{
379374
this.parent.remove(this);
@@ -393,6 +388,8 @@ Phaser.Image.prototype.destroy = function() {
393388
this.exists = false;
394389
this.visible = false;
395390

391+
this.filters = null;
392+
this.mask = null;
396393
this.game = null;
397394

398395
}

src/gameobjects/Sprite.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,6 @@ Phaser.Sprite.prototype.kill = function() {
491491
*/
492492
Phaser.Sprite.prototype.destroy = function() {
493493

494-
if (this.filters)
495-
{
496-
this.filters = null;
497-
}
498-
499494
if (this.parent)
500495
{
501496
this.parent.remove(this);
@@ -525,6 +520,8 @@ Phaser.Sprite.prototype.destroy = function() {
525520
this.exists = false;
526521
this.visible = false;
527522

523+
this.filters = null;
524+
this.mask = null;
528525
this.game = null;
529526

530527
};

0 commit comments

Comments
 (0)