Parcourir la source

Fix gui dispose when no ADT

David Catuhe il y a 7 ans
Parent
commit
4d5d40aedd
1 fichiers modifiés avec 5 ajouts et 3 suppressions
  1. 5 3
      gui/src/2D/controls/control.ts

+ 5 - 3
gui/src/2D/controls/control.ts

@@ -1378,9 +1378,11 @@ export class Control {
             this._root = null;
         }
 
-        var index = this._host._linkedControls.indexOf(this);
-        if (index > -1) {
-            this.linkWithMesh(null);
+        if (this._host) {
+            var index = this._host._linkedControls.indexOf(this);
+            if (index > -1) {
+                this.linkWithMesh(null);
+            }
         }
     }