Browse Source

Merge pull request #6879 from BabylonJS/phantom-events

Suggested solution to scenes/engines being disposed incorrectly
David Catuhe 6 years ago
parent
commit
7009c92207
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Engines/engine.ts

+ 2 - 2
src/Engines/engine.ts

@@ -1903,8 +1903,6 @@ export class Engine extends ThinEngine {
     public dispose(): void {
         this.hideLoadingUI();
 
-        super.dispose();
-
         this.onNewSceneAddedObservable.clear();
 
         // Release postProcesses
@@ -1953,6 +1951,8 @@ export class Engine extends ThinEngine {
             document.removeEventListener("webkitpointerlockchange", this._onPointerLockChange);
         }
 
+        super.dispose();
+
         // Remove from Instances
         var index = Engine.Instances.indexOf(this);