Bläddra i källkod

Latest fix for memory checker

David Catuhe 7 år sedan
förälder
incheckning
f16a4a05bc
2 ändrade filer med 9 tillägg och 1 borttagningar
  1. 1 1
      tests/memoryChecks/index.js
  2. 8 0
      tests/validation/validation.js

+ 1 - 1
tests/memoryChecks/index.js

@@ -27,7 +27,7 @@ BABYLONDEVTOOLS.Loader.require('../validation/validation.js')
                 }
 
                 runTest(index, function() {
-                    BABYLON.Engine.LastCreatedEngine.dispose();
+                    dispose();
                     needInit = true;
                 });
             }

+ 8 - 0
tests/validation/validation.js

@@ -322,4 +322,12 @@ function init() {
     engine.setDitheringState(false);
 }
 
+function dispose() {
+    engine.dispose();
+    currentScene = null;
+    engine = null;
+    document.body.removeChild(canvas);
+    canvas = null;
+}
+
 init();