This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[UWP] CollectionView Memory Leak #14780
Merged
jfversluis
merged 10 commits into
xamarin:5.0.0
from
YZahringer:bug-uwp-collectionview-memory-leak
Dec 30, 2021
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ac0d7cf
unsubscribe from oldElement on TearDownOldElement
YZahringer 6956a00
Cleanup ItemContentControl.DataContext on CleanUpCollectionViewSource
YZahringer e5d250c
Merge branch 'xamarin:5.0.0' into bug-uwp-collectionview-memory-leak
YZahringer bf47939
Merge branch 'xamarin:5.0.0' into bug-uwp-collectionview-memory-leak
YZahringer caf1e1e
Merge branch 'xamarin:5.0.0' into bug-uwp-collectionview-memory-leak
YZahringer 8fd6809
Merge branch 'xamarin:5.0.0' into bug-uwp-collectionview-memory-leak
YZahringer 9f4d7c8
Merge branch 'xamarin:5.0.0' into bug-uwp-collectionview-memory-leak
YZahringer 6547b5c
Merge branch 'xamarin:5.0.0' into bug-uwp-collectionview-memory-leak
YZahringer cce4293
Merge branch 'xamarin:5.0.0' into bug-uwp-collectionview-memory-leak
YZahringer 8510674
Merge branch 'xamarin:5.0.0' into bug-uwp-collectionview-memory-leak
YZahringer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm not sure about this
null
assignment, but if we don't do it, the memory leak persists.I also tried calling
SetInheritedBindingContext(oldStructuredItemsView.ItemsLayout, null)
instead, without success.@jsuarezruiz maybe you have an idea or can validate that this should not produce side effects?
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.
Hey Yann! Sorry I only got to this now. I will try and think how we can validate this. I assume you tested this yourself? Are you using this code now in any of your apps by any chance?
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.
Hi Gerald, I use the simple project available here with VS Diagnostics Tools to reproduce/check the fix.
For the moment, on production we use an extended renderer as workaround on many apps. Not exactly the same code, because there are private/internal on the base renderer, but the result is the same:
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.
When the build completes there should be NuGets produced, would you maybe be able to try them out on projects where you have this problem and see if this works as expected and doesn't break anything else? The instructions can be found here. That would be very helpful, thanks!
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.
I did some tests with the nuget produced on an application with multiple
CollectionView
on different views, the Memory Leak is solved.By the way, I also updated the test project.
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.
Thanks for the cooperation @YZahringer !