-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Conversation
@@ -223,12 +224,19 @@ public static ControlTemplate DefaultTemplate | |||
{ | |||
get | |||
{ | |||
if (s_defaultTemplate == null) | |||
ControlTemplate defaultTemplate = null; |
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.
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?
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.
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));
Noticed the test didn't pass, I don't think this PR will fix it as these are the underlying issues: #20023 (comment) |
Close in favor of #21151 |
Description of Change
RadioButton being Garbage Collected on iOS.
Issues Fixed
Fixes #20023