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:
Richard Davey 2018-09-29 11:21:41 +01:00
parent 8b5d0a3af1
commit 3c4e6cda80

View file

@ -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);