Clear WindowInfo Hashset before refilling.
This commit is contained in:
parent
02314701f4
commit
2461232b5b
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user