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

Memory leak: Event listeners not removing #97

Closed
cawa-93 opened this issue May 15, 2021 · 0 comments · Fixed by jellyfin/JavascriptSubtitlesOctopus#37
Closed

Memory leak: Event listeners not removing #97

cawa-93 opened this issue May 15, 2021 · 0 comments · Fixed by jellyfin/JavascriptSubtitlesOctopus#37

Comments

@cawa-93
Copy link
Contributor

cawa-93 commented May 15, 2021

After init, the JSO creates many event listeners, and none of them is removed even if i call instance.dispose();

This is very noticeable especially if you work with SPA: even when you go to another "page", and the target video element was removed from DOM, event listeners continue to work.

I think this is what leads to a constant memory leak: None of the created instances of the class can be destroyed by the garbage collector.
зображення
зображення

@cawa-93 cawa-93 changed the title Event listeners not removed Memory leak: Event listeners not removing May 15, 2021
TheOneric pushed a commit to TheOneric/JavascriptSubtitlesOctopus that referenced this issue May 21, 2022
Remove all listeners so that the octopus is not reachable
from the window.

Cherry-picked from: jellyfin@701e129
Fixes: libass#97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants