DataManagerPlugin would throw an error on Game.destroy if you had any Scenes in the Scene Manager had not been run. Fix #3596

This commit is contained in:
Richard Davey 2018-04-20 13:34:45 +01:00
parent 4018d6ab39
commit e3aa437340
3 changed files with 3 additions and 10 deletions

View file

@ -13,7 +13,7 @@
### Bug Fixes
* DataManagerPlugin would throw an error on Game.destroy if you had any Scenes in the Scene Manager had not been run. Fix #3596 (thanks @kuoruan)
## Version 3.6.0 - Asuna - 19th April 2018

View file

@ -92,7 +92,7 @@ var DataManager = new Class({
*/
this._frozen = false;
if (this.events)
if (!parent.hasOwnProperty('sys') && this.events)
{
this.events.once('destroy', this.destroy, this);
}

View file

@ -80,13 +80,6 @@ var DataManagerPlugin = new Class({
*/
start: function ()
{
if (this.events)
{
this.events.off('destroy', this.destroy, this);
}
this.events = this.systems.events;
this.events.once('shutdown', this.shutdown, this);
},
@ -114,7 +107,7 @@ var DataManagerPlugin = new Class({
{
DataManager.prototype.destroy.call(this);
this.systems.events.off('start', this.start, this);
this.events.off('start', this.start, this);
this.scene = null;
this.systems = null;