소스 검색

Prevent infinite loop via engine.dispose()

It appears that the MainSoundTrack was getting added to the scene's list of soundtracks, and receiving an id > -1. This caused multiple problems. The worst symptom was an infinite loop after calling engine.dispose()!
Drew Petersen 5 년 전
부모
커밋
766f0e5833
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Audio/soundTrack.ts

+ 1 - 1
src/Audio/soundTrack.ts

@@ -51,7 +51,7 @@ export class SoundTrack {
         this.soundCollection = new Array();
         this._options = options;
 
-        if (!this._isMainTrack && this._scene.soundTracks) {
+        if (!this.options.mainTrack && this._scene.soundTracks) {
             this._scene.soundTracks.push(this);
             this.id = this._scene.soundTracks.length - 1;
         }