diff --git a/CHANGELOG.md b/CHANGELOG.md index 566fc8355..8c9e965eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [55.2.3] +- [iOS][SearchBar] Fixed memory leak where `SearchButtonClicked` event was never unsubscribed due to wrong event name in cleanup +- [iOS][Camera] Fixed memory leak where `PreviewView.OnTapToFocus` event was never unsubscribed when stopping camera session +- [SlidableLayout] Fixed memory leak where `TapGestureRecognizer.Tapped` event was never unsubscribed due to missing field reference + ## [55.2.2] - [iOS26][Tip] Added more padding. diff --git a/src/library/DIPS.Mobile.UI/API/Camera/Shared/iOS/CameraSession.cs b/src/library/DIPS.Mobile.UI/API/Camera/Shared/iOS/CameraSession.cs index 5e663dbd2..ef573f33a 100644 --- a/src/library/DIPS.Mobile.UI/API/Camera/Shared/iOS/CameraSession.cs +++ b/src/library/DIPS.Mobile.UI/API/Camera/Shared/iOS/CameraSession.cs @@ -78,6 +78,7 @@ await Task.Run(() => if (PreviewView is not null) { PreviewView.OnZoomChanged -= PreviewViewOnZoomChanged; + PreviewView.OnTapToFocus -= PreviewViewOnOnTapToFocus; PreviewView?.Dispose(); PreviewView = null; } diff --git a/src/library/DIPS.Mobile.UI/Components/Searching/iOS/SearchBarHandler.cs b/src/library/DIPS.Mobile.UI/Components/Searching/iOS/SearchBarHandler.cs index 38e5d4699..527c2e7cf 100644 --- a/src/library/DIPS.Mobile.UI/Components/Searching/iOS/SearchBarHandler.cs +++ b/src/library/DIPS.Mobile.UI/Components/Searching/iOS/SearchBarHandler.cs @@ -224,7 +224,7 @@ private void OnSearchButtonClicked(object? sender, EventArgs e) private void UnSubscribeToEvents(DuiSearchBar platformView) { platformView.CancelButtonClicked -= OnCancelButtonClicked; - platformView.CancelButtonClicked -= OnSearchButtonClicked; + platformView.SearchButtonClicked -= OnSearchButtonClicked; platformView.TextChanged -= OnSearchTextChanged; if (platformView.SearchTextField.ValueForKey(new NSString("_clearButton")) is UIButton clearButton) diff --git a/src/library/DIPS.Mobile.UI/Components/Slidable/SlidableLayout.cs b/src/library/DIPS.Mobile.UI/Components/Slidable/SlidableLayout.cs index 176708c4d..7ae8f6955 100644 --- a/src/library/DIPS.Mobile.UI/Components/Slidable/SlidableLayout.cs +++ b/src/library/DIPS.Mobile.UI/Components/Slidable/SlidableLayout.cs @@ -8,6 +8,7 @@ namespace DIPS.Mobile.UI.Components.Slidable public abstract partial class SlidableLayout : ContentView { private readonly PanGestureRecognizer m_panGestureRecognizer; + private readonly TapGestureRecognizer m_tapGestureRecognizer; private readonly AccelerationService m_accelerator = new(true); private int m_lastId = -2; // Different than default of SlideProperties private double m_startSlideLocation; @@ -37,9 +38,9 @@ public SlidableLayout() m_panGestureRecognizer.PanUpdated += PanGestureRecognizerPanUpdated; - var tapGestureRecognizer = new TapGestureRecognizer(); - GestureRecognizers.Add(tapGestureRecognizer); - tapGestureRecognizer.Tapped += OnEntireLayoutTapped; + m_tapGestureRecognizer = new TapGestureRecognizer(); + GestureRecognizers.Add(m_tapGestureRecognizer); + m_tapGestureRecognizer.Tapped += OnEntireLayoutTapped; m_currentOrientation = DeviceDisplay.MainDisplayInfo.Orientation; } @@ -296,6 +297,7 @@ protected override void OnHandlerChanging(HandlerChangingEventArgs args) if (args.NewHandler is null) { m_panGestureRecognizer.PanUpdated -= PanGestureRecognizerPanUpdated; + m_tapGestureRecognizer.Tapped -= OnEntireLayoutTapped; } } }