maui
maui copied to clipboard
Border.StrokeShape is not currently being Garbage Collected
Description
Hi
Possibly related to: https://github.com/dotnet/maui/issues/20163
When I add the following Xaml to a page, the page doesn't get garbage collected any more when navigating back:
<Border>
<Border.StrokeShape>
<RoundRectangle CornerRadius="5" />
</Border.StrokeShape>
<Label Text="Border with StrokeShape is leaking" />
</Border>
Steps to Reproduce
- Run the project
- Click Button and go back again multiple times
- Observe that
~Page2()never gets called
Link to public reproduction project repository
https://github.com/marco-skizza/MauiPageMemory
Version with bug
8.0.6 SR1
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, I was not able test on other platforms
Affected platform versions
iPadOS 17.3.1 on iPad mini 6
Did you find any workaround?
No
Relevant log output
No response
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.
this is not only ios related. Same thing happen on Android in case you make a global Style for a Border (https://github.com/dotnet/maui/issues/20163)
something like this
<Style x:Key="FooterStyle" TargetType="Border"> <Setter Property="StrokeShape"> <Setter.Value> <RoundRectangle CornerRadius="16,16,0,0" /> </Setter.Value> </Setter> </Style>
Verified this on VS 17.10.0 Preview 2.0(8.0.10). Repro on iOS 17.2 and MacCatalyst, not repro on Windows 11, Android 14.0-API34 with below Project: MauiPageMemory.zip
Seems to be fixed with .NET MAUI 8.0.20. Thanks!