Skip to content

Commit 9a3340f

Browse files
committed
Exit if scene was removed during create()
1 parent 89fe81a commit 9a3340f

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

src/scene/SceneManager.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,11 @@ var SceneManager = new Class({
610610
settings.status = CONST.CREATING;
611611

612612
scene.create.call(scene, settings.data);
613+
614+
if (settings.status === CONST.DESTROYED)
615+
{
616+
return;
617+
}
613618
}
614619

615620
if (settings.isTransition)
@@ -823,7 +828,7 @@ var SceneManager = new Class({
823828

824829
/**
825830
* Returns an array of all the current Scenes being managed by this Scene Manager.
826-
*
831+
*
827832
* You can filter the output by the active state of the Scene and choose to have
828833
* the array returned in normal or reversed order.
829834
*
@@ -1161,25 +1166,25 @@ var SceneManager = new Class({
11611166
scene.sys.start(data);
11621167

11631168
var loader;
1164-
1169+
11651170
if (scene.sys.load)
11661171
{
11671172
loader = scene.sys.load;
11681173
}
1169-
1174+
11701175
// Files payload?
11711176
if (loader && scene.sys.settings.hasOwnProperty('pack'))
11721177
{
11731178
loader.reset();
1174-
1179+
11751180
if (loader.addPack({ payload: scene.sys.settings.pack }))
11761181
{
11771182
scene.sys.settings.status = CONST.LOADING;
1178-
1183+
11791184
loader.once(LoaderEvents.COMPLETE, this.payloadComplete, this);
1180-
1185+
11811186
loader.start();
1182-
1187+
11831188
return this;
11841189
}
11851190
}

0 commit comments

Comments
 (0)