Skip to content

Commit

Permalink
Fix webaudio's bug: calling the 'checkEnded' interface after 'destroy…
Browse files Browse the repository at this point in the history
…' has been called can trigger a JavaScript error

(cherry picked from commit a8e7f18)
  • Loading branch information
bofeng-song committed Oct 10, 2023
1 parent d79d095 commit c7dba7d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pal/audio/web/player-web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export class AudioPlayerWeb implements OperationQueueable {
game.on(Game.EVENT_RESUME, this._onInterruptedEnd, this);
}
destroy (): void {
window.clearTimeout(this._currentTimer);
this._audioTimer.destroy();
if (this._audioBuffer) {
// NOTE: need to release AudioBuffer instance
Expand Down

0 comments on commit c7dba7d

Please sign in to comment.