Skip to content

Commit 16203a3

Browse files
committed
PIXI.defaultRenderer is now set to null in Game.destroy, allowing it to be reset if a new Game instance is created on the same page (thanks @xtforgame #phaserjs#2474)
1 parent fd8f611 commit 16203a3

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
349349
* Docs typo fixes (thanks @dedoubleyou1)
350350
* You can now access the intensity of the Camera shake effect via the getter / setter `Camera.shakeIntensity`. Useful if you wish to tween the intensity while running. (thanks @drhayes #2443)
351351
* The Arcade Physics overlap method would return false if two bodies were overlapping but neither had any velocity (i.e. they were embedded into each other)
352+
* PIXI.defaultRenderer is now set to `null` in Game.destroy, allowing it to be reset if a new Game instance is created on the same page (thanks @xtforgame ##2474)
352353

353354
### Bug Fixes
354355

src/core/Game.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,6 +1002,11 @@ Phaser.Game.prototype = {
10021002
/**
10031003
* Nukes the entire game from orbit.
10041004
*
1005+
* Calls destroy on Game.state, Game.sound, Game.scale, Game.stage, Game.input, Game.physics and Game.plugins.
1006+
*
1007+
* Then sets all of those local handlers to null, destroys the renderer, removes the canvas from the DOM
1008+
* and resets the PIXI default renderer.
1009+
*
10051010
* @method Phaser.Game#destroy
10061011
*/
10071012
destroy: function () {
@@ -1035,6 +1040,8 @@ Phaser.Game.prototype = {
10351040

10361041
Phaser.Canvas.removeFromDOM(this.canvas);
10371042

1043+
PIXI.defaultRenderer = null;
1044+
10381045
Phaser.GAMES[this.id] = null;
10391046

10401047
},

0 commit comments

Comments
 (0)