X Tutup
The Wayback Machine - https://web.archive.org/web/20220509033124/https://github.com/angular/components/pull/21222
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(material/expansion): not clearing custom query list #21222

Merged
merged 1 commit into from Dec 8, 2020

Conversation

Copy link
Member

@crisbeto crisbeto commented Dec 4, 2020

MatAccordion has a custom QueryList for keeping track of its own headers which we weren't destroying. These changes add a call to destroy it since it has the potential of leaking memory.

`MatAccordion` has a custom `QueryList` for keeping track of its own headers which we weren't
destroying. These changes add a call to destroy it since it has the potential of leaking memory.
@crisbeto crisbeto added P3 target: patch labels Dec 4, 2020
@crisbeto crisbeto requested a review from jelbourn as a code owner Dec 4, 2020
@google-cla google-cla bot added the cla: yes label Dec 4, 2020
wagnermaciel
wagnermaciel previously approved these changes Dec 4, 2020
Copy link
Contributor

@wagnermaciel wagnermaciel left a comment

LGTM

@wagnermaciel
Copy link

@wagnermaciel wagnermaciel commented Dec 4, 2020

@crisbeto @jelbourn This looks LGTM, but doesn't QueryList already get called when the component is destroyed?
https://github.com/angular/angular/blob/master/packages/core/src/view/view.ts#L547

The docs for QueryList.destroy() just say "internal", which seems to imply that we aren't meant to call this.
https://angular.io/api/core/QueryList#destroy

@wagnermaciel wagnermaciel self-requested a review Dec 4, 2020
@wagnermaciel wagnermaciel dismissed their stale review Dec 4, 2020

I'd like to understand why we need to call QueryList.destroy() first, since it should be handled internally.

@crisbeto
Copy link
Author

@crisbeto crisbeto commented Dec 4, 2020

destroy won't be called for this QueryList in particular, because we construct it manually. Only the ones constructed by the framework are cleaned up automatically.

Copy link
Contributor

@wagnermaciel wagnermaciel left a comment

LGTM again

@crisbeto crisbeto added the merge ready label Dec 5, 2020
@wagnermaciel wagnermaciel merged commit 2076686 into angular:master Dec 8, 2020
16 checks passed
wagnermaciel pushed a commit that referenced this issue Dec 8, 2020
`MatAccordion` has a custom `QueryList` for keeping track of its own headers which we weren't
destroying. These changes add a call to destroy it since it has the potential of leaking memory.

(cherry picked from commit 2076686)
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Jan 8, 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 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes merge ready P3 target: patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants
X Tutup