Fixes #382 Error when using InputHandler#onInputUp & sprite destroys itself during the event.

This commit is contained in:
photonstorm
2014-02-10 02:14:59 +00:00
parent 0294a4735d
commit ae74cb02dd
5 changed files with 62 additions and 16 deletions
+5 -5
View File
@@ -491,11 +491,6 @@ Phaser.Sprite.prototype.destroy = function() {
this.parent.remove(this);
}
if (this.events)
{
this.events.destroy();
}
if (this.input)
{
this.input.destroy();
@@ -511,6 +506,11 @@ Phaser.Sprite.prototype.destroy = function() {
this.body.destroy();
}
if (this.events)
{
this.events.destroy();
}
this.alive = false;
this.exists = false;
this.visible = false;