From 883e39dfbfe10862fdf38ea88b723ac6d05b4492 Mon Sep 17 00:00:00 2001 From: Shane Neuville Date: Mon, 3 Jun 2024 10:40:19 -0500 Subject: [PATCH] Revert "[ios] fix memory leak in RadioButton --- src/Controls/src/Core/Border/Border.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Controls/src/Core/Border/Border.cs b/src/Controls/src/Core/Border/Border.cs index 2ac3f7ba4380..570f1c93d1e0 100644 --- a/src/Controls/src/Core/Border/Border.cs +++ b/src/Controls/src/Core/Border/Border.cs @@ -64,13 +64,10 @@ void NotifyStrokeShapeChanges() if (strokeShape is VisualElement visualElement) { - SetInheritedBindingContext(visualElement, BindingContext); + AddLogicalChild(visualElement); _strokeShapeChanged ??= (sender, e) => OnPropertyChanged(nameof(StrokeShape)); _strokeShapeProxy ??= new(); _strokeShapeProxy.Subscribe(visualElement, _strokeShapeChanged); - - OnParentResourcesChanged(this.GetMergedResources()); - ((IElementDefinition)this).AddResourcesChangedListener(visualElement.OnParentResourcesChanged); } } @@ -80,9 +77,7 @@ void StopNotifyingStrokeShapeChanges() if (strokeShape is VisualElement visualElement) { - ((IElementDefinition)this).RemoveResourcesChangedListener(visualElement.OnParentResourcesChanged); - - SetInheritedBindingContext(visualElement, null); + RemoveLogicalChild(visualElement); _strokeShapeProxy?.Unsubscribe(); } }