Skip to content

Commit 5ccac59

Browse files
committed
Updated docs and destroy properties
1 parent b28a727 commit 5ccac59

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Please see the complete JSDocs for the ScenePlugin for more details, as well as
5555
* When shutting down a Scene all Game Objects that belong to the scene will now automatically destroy themselves. They would previously be removed from the display and update lists, but the objects themselves didn't self-destruct. You can control this on a per-object basis with the `ignoreDestroy` property.
5656
* A Matter Mouse Spring will disable debug draw of its constraint by default (you can override it by passing in your own config)
5757
* The RandomDataGenerator class is now exposed under Phaser.Math should you wish to instantiate it yourself. Fix #3576 (thanks @wtravO)
58+
* Refined the Game.destroy sequence, so it will now only destroy the game at the start of the next frame, not during processing.
5859

5960
### Examples, Documentation and TypeScript
6061

src/boot/Game.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ var Game = new Class({
243243
this.onStepCallback = NOOP;
244244

245245
/**
246-
* Is this Game pending destroy at the end of the next frame?
246+
* Is this Game pending destruction at the start of the next frame?
247247
*
248248
* @name Phaser.Game#pendingDestroy
249249
* @type {boolean}
@@ -552,17 +552,19 @@ var Game = new Class({
552552
},
553553

554554
/**
555-
* Destroys this Phaser.Game instance, all global systems, all sub-systems and all Scenes.
555+
* Flags this Game instance as needing to be destroyed on the next frame.
556+
* It will wait until the current frame has completed and then call `runDestroy` internally.
556557
*
557558
* @method Phaser.Game#destroy
558559
* @since 3.0.0
560+
*
561+
* @param {boolean} removeCanvas - Set to `true` if you would like the parent canvas element removed from the DOM, or `false` to leave it in place.
559562
*/
560563
destroy: function (removeCanvas)
561564
{
562565
this.pendingDestroy = true;
563-
this.removeCanvas = removeCanvas;
564566

565-
this.loop.stop();
567+
this.removeCanvas = removeCanvas;
566568
},
567569

568570
/**

0 commit comments

Comments
 (0)