Fix cell view link mismatch

This commit is contained in:
Sinai
2021-05-06 16:47:37 +10:00
parent 6c7acf7690
commit 9e8a18a5e1
8 changed files with 31 additions and 220 deletions

View File

@ -57,7 +57,10 @@ namespace UnityExplorer.UI.IValues
values.Clear();
foreach (var entry in cachedEntries)
{
entry.UnlinkFromView();
entry.ReleasePooledObjects();
}
cachedEntries.Clear();
}
@ -166,10 +169,15 @@ namespace UnityExplorer.UI.IValues
var entry = cachedEntries[index];
if (cell.Occupant != null && entry != cell.Occupant)
if (entry.CellView != null && entry.CellView != cell)
entry.UnlinkFromView();
if (cell.Occupant != null && cell.Occupant != entry)
cell.Occupant.UnlinkFromView();
entry.SetView(cell);
if (entry.CellView != cell)
entry.SetView(cell);
entry.SetDataToCell(cell);
SetCellLayout(cell);