You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a component is unmounted, event listeners which were attached to document on component mount are not removed. This leads to a memory leak as there are unused event listeners leftover after components unmount.
This can be verified by using chrome devtools, and taking heap snapshots at various points throughout page navigation/components mounting and unmounting, where the number of event listeners increases over time. It can also be verified in elements -> event listeners tab in devtools, where there are an increasing number of listeners upon mounting and unmounting components.
I'm not sure if this is the correct way of reporting an issue (making a fix as well as issue ticket), but just wanted more visibility here. If not, feel free to close this one.
Reproduction
Call unmount() on a component, observe how document event listeners are still retained, number of event listeners in memory using chrome memory devtools will show increasing amount as components are unmounted
Closed with #12105. Thanks also for putting up a fix! Sorry I missed it originally – it's quite rare for someone to put up an issue and link to the fix at the same time :)
Describe the bug
When a component is unmounted, event listeners which were attached to
document
on component mount are not removed. This leads to a memory leak as there are unused event listeners leftover after components unmount.This can be verified by using chrome devtools, and taking heap snapshots at various points throughout page navigation/components mounting and unmounting, where the number of event listeners increases over time. It can also be verified in elements -> event listeners tab in devtools, where there are an increasing number of listeners upon mounting and unmounting components.
Fix is here: #12101
I'm not sure if this is the correct way of reporting an issue (making a fix as well as issue ticket), but just wanted more visibility here. If not, feel free to close this one.
Reproduction
Call unmount() on a component, observe how document event listeners are still retained, number of event listeners in memory using chrome memory devtools will show increasing amount as components are unmounted
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: