Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use revokeObjectURL dispose for created MSE blob urls #849

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

brandonocasey
Copy link
Contributor

Prevents a memory leak that we have right now, caused by not revoking urls that we create.

Copy link
Contributor

@gesinger gesinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth a test, otherwise looks good.

Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something we can reasonably add a test to?

@@ -829,6 +831,11 @@ class HlsHandler extends Component {
delete this.tech_.hls;
}

if (this.mediaSourceUrl_ && window.URL.revokeObjectURL) {
window.URL.revokeObjectURL(this.mediaSourceUrl_);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we could've gotten the blob url via this.tech_.src() but I think this is fine as well.

@brandonocasey
Copy link
Contributor Author

brandonocasey commented May 21, 2020

Added a test. 🤞 for ie 11...

gesinger
gesinger previously approved these changes May 21, 2020
@gkatsev gkatsev added this to the 2.1 milestone May 21, 2020
gkatsev
gkatsev previously approved these changes Jun 12, 2020
@brandonocasey brandonocasey merged commit ca73cac into master Jun 18, 2020
@gkatsev gkatsev deleted the fix/revoke-mse-urls branch June 26, 2020 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants