mirror of
https://github.com/photonstorm/phaser
synced 2025-02-18 06:58:30 +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 ()
|
shutdown: function ()
|
||||||
{
|
{
|
||||||
|
if (!this.world)
|
||||||
|
{
|
||||||
|
// Already destroyed
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var eventEmitter = this.systems.events;
|
var eventEmitter = this.systems.events;
|
||||||
|
|
||||||
eventEmitter.off('update', this.world.update, this.world);
|
eventEmitter.off('update', this.world.update, this.world);
|
||||||
|
|
Loading…
Add table
Reference in a new issue