vue-dropdown icon indicating copy to clipboard operation
vue-dropdown copied to clipboard

Event listener never removed leads to memory leak

Open felicien-brochu opened this issue 4 years ago • 2 comments

The "resize" listener added on window here: https://github.com/JonathanDn/vue-dropdown/blob/03ba5754c370fa257277fb7ca1d7ce6250a4f179/dropdown.vue#L96 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.

felicien-brochu avatar Apr 12 '20 08:04 felicien-brochu

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

MitchellBouwman avatar Oct 03 '20 10:10 MitchellBouwman

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.

JonathanDn avatar Oct 09 '20 20:10 JonathanDn