Explorar o código

fix(Scene): Dispose of timer that may not have been cleared if the scene
was never ready.

Zak Henry %!s(int64=6) %!d(string=hai) anos
pai
achega
12fece8842
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      src/scene.ts

+ 6 - 0
src/scene.ts

@@ -1860,6 +1860,12 @@ export class Scene extends AbstractScene implements IAnimatable {
             return;
         }
 
+        if (this._isDisposed) {
+            this.onReadyObservable.clear();
+            this._executeWhenReadyTimeoutId = -1;
+            return;
+        }
+
         this._executeWhenReadyTimeoutId = setTimeout(() => {
             this._checkIsReady();
         }, 150);