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

RadioButton being Garbage Collected #20472

Closed
wants to merge 5 commits into from
Closed

RadioButton being Garbage Collected #20472

wants to merge 5 commits into from

Conversation

jsuarezruiz
Copy link
Contributor

Description of Change

RadioButton being Garbage Collected on iOS.

Issues Fixed

Fixes #20023

@jsuarezruiz jsuarezruiz added platform/iOS 🍎 legacy-area-perf Startup / Runtime performance area-controls-radiobutton RadioButton, RadioButtonGroup labels Feb 9, 2024
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Feb 9, 2024
@@ -223,12 +224,19 @@ public static ControlTemplate DefaultTemplate
{
get
{
if (s_defaultTemplate == null)
ControlTemplate defaultTemplate = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you narrow down to what was leaking? I worry that fixing this via the ControlTemplate is just fixing a symptom instead of the cause. For example, if something in the template is leaking this will probably fix it but we probably want to fix that leak instead.

For example, if you just set the datatemplate to something really boring does it still leak?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah so it looks like part of the memory leak occurs here in the BuildDefaultTemplate method:

border.SetBinding(Border.StrokeShapeProperty,
				new Binding(CornerRadiusProperty.PropertyName, converter: new CornerRadiusToShape(),
							source: RelativeBindingSource.TemplatedParent));

@jonathanpeppers
Copy link
Member

Noticed the test didn't pass, I don't think this PR will fix it as these are the underlying issues: #20023 (comment)

@jsuarezruiz
Copy link
Contributor Author

Close in favor of #21151

@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2024
@Eilon Eilon added t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) and removed legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor legacy-area-perf Startup / Runtime performance labels May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-radiobutton RadioButton, RadioButtonGroup platform/iOS 🍎 t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RadioButton is not currently being Garbage Collected
5 participants