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

Event listener never removed leads to memory leak #14

Open
felicien-brochu opened this issue Apr 12, 2020 · 2 comments
Open

Event listener never removed leads to memory leak #14

felicien-brochu opened this issue Apr 12, 2020 · 2 comments
Labels

Comments

@felicien-brochu
Copy link

The "resize" listener added on window here:

window.addEventListener("resize", calcHeight);

is never removed. It leads to memory leak.
Also I think you should not use a directive here. Because you cannot retain a reference to the closure calcHeight() in the directive, so you won't be able to remove the listener afterwards.

@MitchellBouwman
Copy link

That's not true, in the destroyed() hook is a removeEventListener.

@JonathanDn
Copy link
Owner

Hey @felicien-brochu those are 2 separate issues please open a new issues for the directive issue and lets discuss there.

About the event listener, feel free to open a PR with the fix to remove that listener.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants