Skip to content

Commit f2ba7bc

Browse files
authored
[SortControlBottomSheet] Fix memory leak. (#843)
1 parent 7bacbce commit f2ba7bc

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [55.6.9]
2+
- [SortControlBottomSheet] Fix memory leak.
3+
14
## [55.6.8]
25
- [Shell] Fixed memory leak when Shell items change where child component handlers were not disconnected on iOS, and neither page nor child handlers were disconnected on Android
36
- [MemoryManagement] Fixed false-positive memory leak reports when BindingContext is a string

src/library/DIPS.Mobile.UI/Components/Sorting/SortControlBottomSheet.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace DIPS.Mobile.UI.Components.Sorting;
1919

2020
internal class SortControlBottomSheet : BottomSheet
2121
{
22-
private readonly SortControl m_sortControl;
22+
private SortControl m_sortControl;
2323

2424
private readonly CollectionView m_collectionView = new() { ItemSpacing = Sizes.GetSize(SizeName.size_0)};
2525

@@ -115,7 +115,16 @@ private object LoadTemplate()
115115
return radioButtonListItem;
116116
}
117117

118-
118+
119+
protected override void OnHandlerChanged()
120+
{
121+
base.OnHandlerChanged();
122+
123+
if (Handler is null)
124+
{
125+
m_sortControl = null;
126+
}
127+
}
119128
}
120129
internal class SortElementHintConverter : IValueConverter
121130
{

0 commit comments

Comments
 (0)