Fixed Sprite.destroy with an arcade body

This commit is contained in:
Richard Davey 2014-03-15 01:06:01 +00:00
parent 5e11b1ad87
commit fc5504f8d8
2 changed files with 12 additions and 0 deletions

View file

@ -58,6 +58,7 @@ Version 2.0.1 - "Aes Sedai" - -in development-
Bug Fixes
* The Static, Kinematic and Dynamic consts that P2.Body uses were incorrect (fixes #563)
* Sprite.destroy would fail if it had an Arcade Physics body, now added.

View file

@ -438,6 +438,17 @@ Phaser.Physics.Arcade.Body.prototype = {
},
/**
* Removes this bodies reference to its parent sprite, freeing it up for gc.
*
* @method Phaser.Physics.Arcade#destroy
*/
destroy: function () {
this.sprite = null;
},
/**
* Internal method.
*