Skip to content

Commit

Permalink
fix: Clear preload array before awaiting destroy (#6584)
Browse files Browse the repository at this point in the history
This could be relevant if destroy() is called multiple times in a row.

Based on a comment on #6576
  • Loading branch information
theodab authored and avelad committed May 13, 2024
1 parent 6cb3157 commit fc49dde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
preloadManagerDestroys.push(preloadManager.destroy());
}
}
await Promise.all(preloadManagerDestroys);
this.createdPreloadManagers_ = [];
await Promise.all(preloadManagerDestroys);

// Tear-down the event managers to ensure handlers stop firing.
if (this.globalEventManager_) {
Expand Down

0 comments on commit fc49dde

Please sign in to comment.