Make IShape in MauiCALayer a WeakReference#28412
Merged
PureWeen merged 2 commits intodotnet:inflight/currentfrom Mar 18, 2025
Merged
Make IShape in MauiCALayer a WeakReference#28412PureWeen merged 2 commits intodotnet:inflight/currentfrom
PureWeen merged 2 commits intodotnet:inflight/currentfrom
Conversation
Contributor
|
Hey there @MarcelStommel! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
jsuarezruiz
suggested changes
Mar 17, 2025
Contributor
jsuarezruiz
left a comment
There was a problem hiding this comment.
We have some specific tests to verify that controls not leaks here
But, not cover the scenario from https://github.com/MarcelStommel/LayerLeak/
Could you include a new test?
Contributor
Author
|
Added the Device Test as part of BorderTests, since that's also how I did it in https://github.com/MarcelStommel/LayerLeak/ (Sorry about the other GitHub account, I just had to test it on my private MacBook and that was just the easiest way to get the changes pushed.) |
PureWeen
approved these changes
Mar 18, 2025
Member
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
rmarinho
approved these changes
Mar 18, 2025
PureWeen
pushed a commit
that referenced
this pull request
Mar 26, 2025
* Make IShape in MauiCALayer a WeakReference * Added DeviceTest --------- Co-authored-by: Rain336 <rain336@live.de>
PureWeen
pushed a commit
that referenced
this pull request
Mar 26, 2025
* Make IShape in MauiCALayer a WeakReference * Added DeviceTest --------- Co-authored-by: Rain336 <rain336@live.de>
github-actions bot
pushed a commit
that referenced
this pull request
Mar 27, 2025
* Make IShape in MauiCALayer a WeakReference * Added DeviceTest --------- Co-authored-by: Rain336 <rain336@live.de>
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description of Change
Fixes a memory leak in
MauiCALayerby making it'sIShape? _shapefield a weak reference, as proposed in the attached Issue.The leak happens from the fact that most
IShapes are alsoViews and thereby have access to the UI'sNameScopeandx:Nameed elements, which causes a ref-count cycle.Issues Fixed
Fixes #26169
App to reproduce the memory leak / Test the fix: https://github.com/MarcelStommel/LayerLeak