Skip to content

RadioButton being Garbage Collected#20472

Closed
jsuarezruiz wants to merge 5 commits into
mainfrom
fix-20023
Closed

RadioButton being Garbage Collected#20472
jsuarezruiz wants to merge 5 commits into
mainfrom
fix-20023

Conversation

@jsuarezruiz
Copy link
Copy Markdown
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
get
{
if (s_defaultTemplate == null)
ControlTemplate defaultTemplate = null;
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Close in favor of #21151

@github-actions github-actions Bot locked and limited conversation to collaborators Apr 13, 2024
@Eilon Eilon added perf/general 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 perf/general The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RadioButton is not currently being Garbage Collected

5 participants