Skip to content

Commit 41095c2

Browse files
committed
change order in destroy method, first clear references then null all values
1 parent b77c034 commit 41095c2

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/animation/Animation.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,9 @@ Phaser.Animation.prototype = {
371371
* @method Phaser.Animation#destroy
372372
*/
373373
destroy: function () {
374-
374+
this.game.onPause.remove(this.onPause, this);
375+
this.game.onResume.remove(this.onResume, this);
376+
375377
this.game = null;
376378
this._parent = null;
377379
this._frames = null;
@@ -383,9 +385,6 @@ Phaser.Animation.prototype = {
383385
this.onLoop.dispose();
384386
this.onComplete.dispose();
385387

386-
this.game.onPause.remove(this.onPause, this);
387-
this.game.onResume.remove(this.onResume, this);
388-
389388
},
390389

391390
/**

0 commit comments

Comments
 (0)