change order in destroy method, first clear references then null all values

This commit is contained in:
Georgios Kaleadis 2014-04-17 13:16:24 +02:00
parent b77c034f61
commit 41095c2933

View file

@ -371,7 +371,9 @@ Phaser.Animation.prototype = {
* @method Phaser.Animation#destroy
*/
destroy: function () {
this.game.onPause.remove(this.onPause, this);
this.game.onResume.remove(this.onResume, this);
this.game = null;
this._parent = null;
this._frames = null;
@ -383,9 +385,6 @@ Phaser.Animation.prototype = {
this.onLoop.dispose();
this.onComplete.dispose();
this.game.onPause.remove(this.onPause, this);
this.game.onResume.remove(this.onResume, this);
},
/**