mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
67db4305c2
We stop tracking `afterRender` hooks as soon as they execute, but their on destroy callbacks stay registered until either the injector is destroyed or the user calls `destroy` manually. This was leading to memory leaks in the `@defer` triggers based on top of `afterRender` when placed inside long-lived views, because the callback would execute, but its destroy logic was waiting for the view to be destroyed. These changes resolve the issue by destroying the `AfterRenderRef` once it is executed. PR Close #58119