-
Notifications
You must be signed in to change notification settings - Fork 1.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
[Windows] Fix memory leak with GroupedItemTemplateCollection #23386
base: main
Are you sure you want to change the base?
Conversation
src/Controls/src/Core/Platform/Windows/CollectionView/GroupedItemTemplateCollection.cs
Outdated
Show resolved
Hide resolved
src/Controls/src/Core/Platform/Windows/CollectionView/GroupedItemTemplateCollection.cs
Show resolved
Hide resolved
/rebase |
8ec09aa
to
40daa0b
Compare
/rebase |
/azp |
Supported commands
See additional documentation. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
readonly WeakNotifyCollectionChangedProxy _proxy = new(); | ||
bool _disposedValue; | ||
|
||
~GroupedItemTemplateCollection() => _proxy.Unsubscribe(); |
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.
On Dispose you do a null check with ?
operator... Wouldn't make sense to do it here as well?
/rebase |
1 similar comment
/rebase |
await Task.Yield(); | ||
GC.Collect(); | ||
GC.WaitForPendingFinalizers(); |
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.
There is a helper method that does it more robustly, is there not?
This one
public static async Task<bool> WaitForCollect(this WeakReference reference) |
/rebase |
Description of Change
Fix missing event cleanup in
GroupedItemTemplateCollection
to match the cleanup pattern inObservableItemTemplateCollection
. This fixed a minor memory leak with grouped item collections on WindowsIssues Fixed
Fixes #22954