Sfoglia il codice sorgente

Fix gui dispose when no ADT

David Catuhe 7 anni fa
parent
commit
4d5d40aedd
1 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  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);
+            }
         }
     }