-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(service-worker): remove controllerchange
listener when app is destroyed
#55365
fix(service-worker): remove controllerchange
listener when app is destroyed
#55365
Conversation
551c1c4
to
0cbfb5a
Compare
0cbfb5a
to
2b09325
Compare
2b09325
to
299013b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arturovt thanks for the fix! The code looks great, just added 1 minor comment.
…estroyed This commit updates the `ngswAppInitializer` implementation and removes the `controllerchange` listener upon the destruction of the `ApplicationRef`. This adjustment aims to prevent memory leaks. In a zone.js environment, neglecting to do so could lead to the perpetual creation of a zone task, which captures the zone and obstructs proper garbage collection.
299013b
to
aba98f7
Compare
Caretaker note: this change is low-risk, no additional reviews are required, this PR is ready for merge. |
It looks like this has merge conflicts with 17.3. I'm going to put it in v18 only; feel free to send a patch port if you want it in 17.3.x. |
This PR was merged into the repository by commit afe4561. |
…estroyed (#55365) This commit updates the `ngswAppInitializer` implementation and removes the `controllerchange` listener upon the destruction of the `ApplicationRef`. This adjustment aims to prevent memory leaks. In a zone.js environment, neglecting to do so could lead to the perpetual creation of a zone task, which captures the zone and obstructs proper garbage collection. PR Close #55365
This commit updates the
ngswAppInitializer
implementation and removes thecontrollerchange
listener upon the destruction of theApplicationRef
. This adjustment aims to prevent memory leaks. In a zone.js environment, neglecting to do so could lead to the perpetual creation of a zone task, which captures the zone and obstructs proper garbage collection.