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 leak by releasing ref to observed element #49

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

SergeAstapov
Copy link
Contributor

We add an observed element to elements array every time we call .observe() however we don't remove the observed element from elements array when we call .unobserve().

this leads to memory leaks in cases e.g. when we render component and use {{in-viewport}} modifier and then destroy component - reference to the observed element would be held up

@SergeAstapov
Copy link
Contributor Author

Hi @snewcomer! Would you be able to take a look into changes proposed here?

@snewcomer snewcomer merged commit ab520cd into snewcomer:master Jun 25, 2024
@SergeAstapov SergeAstapov deleted the fix-mem-leak branch June 25, 2024 19:04
@github-actions github-actions bot mentioned this pull request Jul 15, 2024
@snewcomer snewcomer added the bug Something isn't working label Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants