Open
Description
Description
Event listeners for 'toastChanged' and 'remove' are not removed before toast is destroyed, so references to the toast stay in the heap. This leads to serious memory leaks with content-heavy toasts.
Reproduction
Initialize vue-cli-project, add snotify. Make a heap snapshot, perform a garbage collection, open 30 timed out toasts, perform a garbage collection, make second snapshot. Memory usage increases significantly due to not removed listeners.
https://codesandbox.io/s/vue-template-46g5e
We added a footprint property to the toast constructor to make the memory leak more visible.
Solution
Remove event listeners before destroying toast.
Metadata
Metadata
Assignees
Labels
No labels