remove invalid capture from history dump

This commit is contained in:
Kang Yu 2024-10-17 13:15:02 -07:00
parent b758dfed2d
commit b02d160872

View file

@ -232,9 +232,18 @@ namespace PersistentWindows.Common
List<int> history = new List<int>();
for (int i = 0; i < dump_apps[display_key][hwnd].Count; ++i)
{
if (dump_apps[display_key][hwnd][i].SnapShotFlags != 0)
continue;
if (!dump_apps[display_key][hwnd][i].IsValid)
history.Add(i);
}
for (int i = history.Count - 1; i >= 0; --i)
{
dump_apps[display_key][hwnd].RemoveAt(history[i]);
}
history.Clear();
for (int i = 0; i < dump_apps[display_key][hwnd].Count; ++i)
{
if (dump_apps[display_key][hwnd][i].SnapShotFlags != 0)
continue;
history.Add(i);
}