From de1b815d5712c26753bb7b9120e81d95f87c6c28 Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Mon, 14 Apr 2025 21:20:21 -0700 Subject: [PATCH] fix dead-loop in TrimQueue() --- .../Common/PersistentWindowProcessor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index 73561c8..91d8df1 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -2214,7 +2214,7 @@ namespace PersistentWindows.Common private void TrimQueue(string displayKey, IntPtr hwnd) { - while (monitorApplications[displayKey][hwnd].Count > MaxHistoryQueueLength) + if (monitorApplications[displayKey][hwnd].Count > MaxHistoryQueueLength) { // limit length of snapshot capture history ulong acc_flags = 0; @@ -2227,7 +2227,6 @@ namespace PersistentWindows.Common { Log.Event($"trim redundant snapshot record for {windowTitle[hwnd]}"); monitorApplications[displayKey][hwnd].RemoveAt(i); - break; } acc_flags |= snapshot_flags; }