Use alternative implementation of preset panel cleanup

This commit is contained in:
Bartłomiej Dach 2022-08-08 21:08:54 +02:00
parent a0a6e1faee
commit f74fb3491e
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
1 changed files with 2 additions and 10 deletions

View File

@ -82,16 +82,8 @@ private void asyncLoadPanels(IRealmCollection<ModPreset> presets, ChangeSet chan
void removeAndDisposePresetPanels()
{
int i = 0;
while (i < ItemsFlow.Count)
{
var item = ItemsFlow[i];
if (item is ModPresetPanel)
item.RemoveAndDisposeImmediately();
else
i++;
}
foreach (var panel in ItemsFlow.OfType<ModPresetPanel>().ToArray())
panel.RemoveAndDisposeImmediately();
}
}