소스 검색

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

Zak Henry 6 년 전
부모
커밋
12fece8842
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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);