Selaa lähdekoodia

Fix gui dispose when no ADT

David Catuhe 7 vuotta sitten
vanhempi
commit
4d5d40aedd
1 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  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);
+            }
         }
     }