Skip to content
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(core): unsubscribe from the onError when the root view is removed #39940

Closed
wants to merge 1 commit into from
Closed

fix(core): unsubscribe from the onError when the root view is removed #39940

wants to merge 1 commit into from

Conversation

arturovt
Copy link
Contributor

@arturovt arturovt commented Dec 2, 2020

PR Checklist

PR Type

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

At the moment, when creating a root module, a subscription to the onError subject is also created. It captures the scope where NgModuleRef is created and prevents it from being garbage collected. Also note that this NgModuleRef has a reference to the root module instance (e.g. AppModule), which also prevents it from being GC'd.

Does this PR introduce a breaking change?

  • Yes
  • No

At the moment, when creating a root module, a subscription to the
`onError` subject is also created. It captures the scope where `NgModuleRef`
is created and prevents it from being garbage collected. Also note that this
`NgModuleRef` has a reference to the root module instance (e.g. `AppModule`),
which also prevents it from being GC'd.
@google-cla google-cla bot added the cla: yes label Dec 2, 2020
@pullapprove pullapprove bot requested a review from mhevery Dec 2, 2020
Copy link
Member

@petebacondarwin petebacondarwin left a comment

Nice PR @arturovt - Keep them coming!

@petebacondarwin petebacondarwin added action: presubmit A standard presubmit is running / required action: review comp: core Runtime issues memory leak Issue related to a memory leak target: patch This PR is targeted for the next patch release labels Dec 3, 2020
@ngbot ngbot bot modified the milestone: needsTriage Dec 3, 2020
mhevery
mhevery approved these changes Dec 3, 2020
@mhevery mhevery added action: merge PR author is ready for this to merge and removed action: presubmit A standard presubmit is running / required action: review labels Dec 3, 2020
@mhevery
Copy link
Contributor

mhevery commented Dec 3, 2020

presubmit

@mhevery mhevery closed this in 5a3a154 Dec 3, 2020
mhevery pushed a commit that referenced this issue Dec 3, 2020
…ed (#39940)

At the moment, when creating a root module, a subscription to the
`onError` subject is also created. It captures the scope where `NgModuleRef`
is created and prevents it from being garbage collected. Also note that this
`NgModuleRef` has a reference to the root module instance (e.g. `AppModule`),
which also prevents it from being GC'd.

PR Close #39940
@arturovt arturovt deleted the unsubscribe-onerror branch Dec 3, 2020
@angular-automatic-lock-bot
Copy link

angular-automatic-lock-bot bot commented Jan 3, 2021

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge PR author is ready for this to merge cla: yes comp: core Runtime issues memory leak Issue related to a memory leak target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants