Explorar el Código

check for null for meshes before disposing

Trevor Baron hace 7 años
padre
commit
b887655144
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. 7 2
      src/Cameras/VR/babylon.vrExperienceHelper.ts

+ 7 - 2
src/Cameras/VR/babylon.vrExperienceHelper.ts

@@ -1386,8 +1386,13 @@ module BABYLON {
                 this._deviceOrientationCamera.dispose();
             }
 
-            this._gazeTracker.dispose();
-            this._teleportationTarget.dispose();
+            if(this._gazeTracker){
+                this._gazeTracker.dispose();
+            }
+            
+            if(this._teleportationTarget){
+                this._teleportationTarget.dispose();
+            }
 
             this._floorMeshesCollection = [];