Forráskód Böngészése

add hasOwnProperty check

Trevor Baron 7 éve
szülő
commit
4c20fdb09f
1 módosított fájl, 5 hozzáadás és 3 törlés
  1. 5 3
      src/Gizmos/babylon.gizmoManager.ts

+ 5 - 3
src/Gizmos/babylon.gizmoManager.ts

@@ -71,9 +71,11 @@ module BABYLON {
 
         private _clearGizmos(){
             for(var key in this._gizmoSet){
-                this._gizmoSet[key].positionGizmo.dispose();
-                this._gizmoSet[key].rotationGizmo.dispose();
-                delete this._gizmoSet[key];
+                if(this._gizmoSet.hasOwnProperty(key)){
+                    this._gizmoSet[key].positionGizmo.dispose();
+                    this._gizmoSet[key].rotationGizmo.dispose();
+                    delete this._gizmoSet[key];
+                }
             }
         }
     }