mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 06:30:38 +00:00
Arcade Physics shutdown
will check to see if the world instance still exists and only try removing it if so. This prevents errors when stopping a world and then destroying it at a later date.
This commit is contained in:
parent
8b5d0a3af1
commit
3c4e6cda80
1 changed files with 6 additions and 0 deletions
|
@ -460,6 +460,12 @@ var ArcadePhysics = new Class({
|
|||
*/
|
||||
shutdown: function ()
|
||||
{
|
||||
if (!this.world)
|
||||
{
|
||||
// Already destroyed
|
||||
return;
|
||||
}
|
||||
|
||||
var eventEmitter = this.systems.events;
|
||||
|
||||
eventEmitter.off('update', this.world.update, this.world);
|
||||
|
|
Loading…
Reference in a new issue