Skip to content

Commit fc5504f

Browse files
committed
Fixed Sprite.destroy with an arcade body
1 parent 5e11b1a commit fc5504f

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Version 2.0.1 - "Aes Sedai" - -in development-
5858
Bug Fixes
5959

6060
* The Static, Kinematic and Dynamic consts that P2.Body uses were incorrect (fixes #563)
61+
* Sprite.destroy would fail if it had an Arcade Physics body, now added.
6162

6263

6364

src/physics/arcade/Body.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,17 @@ Phaser.Physics.Arcade.Body.prototype = {
438438

439439
},
440440

441+
/**
442+
* Removes this bodies reference to its parent sprite, freeing it up for gc.
443+
*
444+
* @method Phaser.Physics.Arcade#destroy
445+
*/
446+
destroy: function () {
447+
448+
this.sprite = null;
449+
450+
},
451+
441452
/**
442453
* Internal method.
443454
*

0 commit comments

Comments
 (0)