fix(core): onDestroy should be registered only on valid DestroyRef#49804
fix(core): onDestroy should be registered only on valid DestroyRef#49804pkozlowski-opensource wants to merge 2 commits intoangular:mainfrom
Conversation
de10cc4 to
95d1754
Compare
|
@pkozlowski-opensource shouldn't we at least log a warning when not in dev mode? I think that users will prefer a warning log message to a potential leak. |
It might happen that the lifecycle scope represented by DestroyRef becomes invalid before an onDestroy hook is registered (ex. injector or component instance got destroyed). In such cases registration of the onDestroy hooks should no longer be possible. Fixes angular#49658
95d1754 to
f975de0
Compare
jessicajaniuk
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
|
FYI, I've also pushed a fixup commit with the golden file update to include a new error code. There were no functional changes in the fixup commit. |
AndrewKushnir
left a comment
There was a problem hiding this comment.
Reviewed-for: public-api
|
Caretaker: This is ready for merge. TGP was green. |
|
This PR was merged into the repository by commit 2c22e6f. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
It might happen that the lifecycle scope represented by DestroyRef becomes invalid before an onDestroy hook is registered (ex. injector or component instance got destroyed). In such cases registration of the onDestroy hooks should no longer be possible.
Fixes #49658