From 2461232b5bd4f4d9d963e95f81c4554507e91ea0 Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 15 Apr 2024 21:47:31 +0200 Subject: [PATCH] Clear WindowInfo Hashset before refilling. --- OBSBlur/Window/WindowManager.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OBSBlur/Window/WindowManager.cs b/OBSBlur/Window/WindowManager.cs index bfba1ff..6aa3430 100644 --- a/OBSBlur/Window/WindowManager.cs +++ b/OBSBlur/Window/WindowManager.cs @@ -8,13 +8,16 @@ public class WindowManager : IDisposable { public readonly HashSet 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; } }