mirror of
https://github.com/wassname/phaser.git
synced 2026-07-03 17:10:40 +08:00
Fixes #382 Error when using InputHandler#onInputUp & sprite destroys itself during the event.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user