$destroy event on $element not firing causing leaks
See original GitHub issueThe $destroy
-event fired on IAugmentedJQuery
(https://docs.angularjs.org/api/ng/function/angular.element#events) when they are removed from DOM is not fired when using ng-metadata. This leads to all sorts of leaks because logic that does cleanup e.g. unregistering $watches are not executed.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Memory leak caused by event listeners attached to knockout ...
The issue is that although knockout removes it's own binding when a row is removed, tipped does not. This is causing a memory...
Read more >Causes of Memory Leaks in JavaScript and How to Avoid Them
In this article, we will explore programming patterns that cause memory leaks in JavaScript and explain how to improve memory management.
Read more >Debug DOM memory leaks with the Detached Elements tool
Identify the DOM node causing others to be retained · Click the Detach Elements ( The Detach Elements icon. ) icon to destroy...
Read more >4 Types of Memory Leaks in JavaScript and How to Get Rid Of ...
The main cause for leaks in garbage collected languages are unwanted references. To understand what unwanted references are, first we need to ...
Read more >Element: mouseenter event - Web APIs | MDN
The mouseenter event is fired at an Element when a pointing device (usually a mouse) is initially moved so that its hotspot is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, ng Material ist leaking in the rootscope. Im in the process of migrating a large app where I recognized leaking watches that weren’t occurring before migrating to ng metadata. This is a showstopper until resolved 😦
element.off() seems to be unnecessary because its done automatically on element remove by jqLite https://github.com/angular/angular.js/blob/d14c7f3c31deb098bf8f1c50ea6d00af758dbdcb/src/jqLite.js#L363