Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,7 @@ internal class ListViewDataSource : UITableViewSource
readonly WeakReference<UITableView> _uiTableView;
readonly WeakReference<FormsUITableViewController> _uiTableViewController;
protected readonly WeakReference<ListView> _list;
readonly HashSet<ContextActionsCell> _contextActionsCells = new();
bool _isDragging;
bool _setupSelection;
bool _selectionFromNative;
Expand Down Expand Up @@ -1113,6 +1114,10 @@ public override UITableViewCell GetCell(UITableView tableView, NSIndexPath index
SetCellBackgroundColor(platformCell, bgColor);
PreserveActivityIndicatorState(cell);
Performance.Stop(reference);

if(platformCell is ContextActionsCell contextActionsCell)
_contextActionsCells.Add(contextActionsCell);

return platformCell;
}

Expand Down Expand Up @@ -1495,12 +1500,16 @@ protected override void Dispose(bool disposing)

if (disposing)
{
if (!_list.TryGetTarget(out var list))
if (_list.TryGetTarget(out var list))
{
list.ItemSelected -= OnItemSelected;
WatchShortNameCollection(false);
}

foreach (var cell in _contextActionsCells)
cell.Dispose();
_contextActionsCells.Clear();

_templateToId = null;
}

Expand Down
Loading