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 leaks when audio context cannot be unlocked (MacOS Safari) #1338

Merged
merged 1 commit into from
May 15, 2020

Conversation

Jimbly
Copy link
Contributor

@Jimbly Jimbly commented May 15, 2020

Symptom is the _html5AudioPool fills with unbounded number of elements if unable to unlock (seen on MacOS Safari).

When not allowed to unlock audio, we're seeing unlock being called on every touch event indefinitely, leaking Audio elements, causing a big slowdown in our app after a few minutes. This happens on Mac OS Safari when audio is not allowed to be unlocked (microphone was in use by another tab, I think).

It appears to also be thrashing AudioBufferSources and related state as it keeps making new sources and trying to play them and binding new onended callbacks, but I don't see an easy way around that.

My fork has diverged quite a bit, but I think this PR captures the change into the right place for the mainline.

@goldfire goldfire merged commit 9075ba2 into goldfire:master May 15, 2020
@Jimbly Jimbly deleted the fix_safari_leak branch May 15, 2020 21:20
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.

2 participants