mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 15:14:47 +00:00
Game.destroy now checks to see if the renderer
exists before calling destroy on it. Fix #3498
This commit is contained in:
parent
d80cccc7f0
commit
d838097763
2 changed files with 6 additions and 2 deletions
|
@ -30,6 +30,7 @@ being passed to the simulation. The default value is 1 to remain consistent with
|
|||
* The Gamepad Axis `getValue` method now correctly applies the threshold and zeroes out the returned value.
|
||||
* The HueToComponent module was not correctly exporting itself. Fix #3482 (thanks @jdotrjs)
|
||||
* Matter.World was using `setZ` instead of `setDepth` for the Debug Graphics Layer, causing it to appear behind objects in some display lists.
|
||||
* Game.destroy now checks to see if the `renderer` exists before calling destroy on it. Fix #3498 (thanks @Huararanga)
|
||||
|
||||
### Updates
|
||||
|
||||
|
|
|
@ -538,7 +538,10 @@ var Game = new Class({
|
|||
|
||||
this.scene.destroy();
|
||||
|
||||
this.renderer.destroy();
|
||||
if (this.renderer)
|
||||
{
|
||||
this.renderer.destroy();
|
||||
}
|
||||
|
||||
this.events.emit('destroy');
|
||||
|
||||
|
@ -546,7 +549,7 @@ var Game = new Class({
|
|||
|
||||
this.onStepCallback = null;
|
||||
|
||||
if (removeCanvas)
|
||||
if (removeCanvas && this.canvas)
|
||||
{
|
||||
CanvasPool.remove(this.canvas);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue