Skip to content

Commit

Permalink
fix: Release region timeline when unloading (shaka-project#4871)
Browse files Browse the repository at this point in the history
This stops the timer inside region timeline from staying in memory, even after the player is destroyed.

Closes shaka-project#4850
  • Loading branch information
theodab committed Jan 7, 2023
1 parent e351395 commit a236180
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/player.js
Expand Up @@ -1537,6 +1537,12 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
has.startTime = null;
has.uri = null;

// Release the region timeline, which is created when parsing the manifest.
if (this.regionTimeline_) {
this.regionTimeline_.release();
this.regionTimeline_ = null;
}

// In most cases we should have a media element. The one exception would
// be if there was an error and we, by chance, did not have a media element.
if (has.mediaElement) {
Expand Down

0 comments on commit a236180

Please sign in to comment.