Clear WindowInfo Hashset before refilling.

This commit is contained in:
glax 2024-04-15 21:47:31 +02:00
parent 02314701f4
commit 2461232b5b

View File

@ -8,13 +8,16 @@ public class WindowManager : IDisposable
{
public readonly HashSet<WindowInfo> Windows = new();
public int UpdateInterval = 10;
private bool KeepUpdating = true;
private bool _keepUpdating = true;
public WindowManager()
{
Thread t = new (() =>
{
while(KeepUpdating)
while (_keepUpdating)
{
Windows.Clear();
EnumWindows(WindowPlacement, 0);
}
Thread.Sleep(UpdateInterval);
});
t.Start();
@ -75,7 +78,7 @@ public class WindowManager : IDisposable
public void Dispose()
{
KeepUpdating = false;
_keepUpdating = false;
}
}