-
Notifications
You must be signed in to change notification settings - Fork 25.7k
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
QueryList.changes Observable is not closed on component destroy (ViewChildren, etc) #18741
Labels
area: core
Issues related to the framework runtime
memory leak
Issue related to a memory leak
type: bug/fix
Comments
vicb
added
area: core
Issues related to the framework runtime
severity3: broken
type: bug/fix
memory leak
Issue related to a memory leak
and removed
severity3: broken
labels
Aug 17, 2017
marclaval
added a commit
to marclaval/angular
that referenced
this issue
Aug 28, 2017
marclaval
added a commit
to marclaval/angular
that referenced
this issue
Aug 28, 2017
mhevery
pushed a commit
to marclaval/angular
that referenced
this issue
Sep 1, 2017
mhevery
pushed a commit
to marclaval/angular
that referenced
this issue
Sep 1, 2017
mhevery
pushed a commit
to marclaval/angular
that referenced
this issue
Sep 1, 2017
mhevery
pushed a commit
that referenced
this issue
Sep 2, 2017
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: core
Issues related to the framework runtime
memory leak
Issue related to a memory leak
type: bug/fix
I'm submitting a...
Current behavior
QueryList.changes
observable (forViewChildren
,ContentChildren
and probably others) is not completed/closed on component destroy. So if there are subscriptions to aQueryList.changes
- it should be explicitly unsubscribed to prevent memory leaks and performance degradation over time.Expected behavior
When component is destroyed - it should implicitly close all
QueryList.changes
observables. Because operations is definitely complete for query list changes on component destroy stage.Minimal reproduction of the problem with instructions
https://plnkr.co/edit/P6tpwaE5Nt2HZuyiSqWj?p=preview
changes.closed
(false) every second)ViewChildren.changes
is not closed.What is the motivation / use case for changing the behavior?
It's unintuitive that component-tracking observable is alive after component destruction and you have explicitly unsubscribe. It causes memory leaks, performance degradation in angular apps.
E.g. angular-material components have this issue, such as MdLineSetter, MdFormField and probably more.
Environment
The text was updated successfully, but these errors were encountered: