From 2b7214e3dd06c8e72b4e50b9d03626405ed28c28 Mon Sep 17 00:00:00 2001 From: Allamagoosa <36551512+dmatlock171@users.noreply.github.com> Date: Sun, 16 Aug 2026 14:13:57 -0700 Subject: [PATCH] Take a copy of the active books before applying the speed limit Same unlocked-enumeration problem as the others: the speed limit is changed from the UI thread while book tasks are starting and finishing, and Active is the live list. --- Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs b/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs index 1a877acc..7ebdc321 100644 --- a/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs +++ b/Source/LibationUiBase/ProcessQueue/ProcessQueueViewModel.cs @@ -102,8 +102,9 @@ public class ProcessQueueViewModel : ReactiveObject : 0; config.DownloadSpeedLimit = (long)(_speedLimit * 1024 * 1024); - // Apply to all currently active books - foreach (var activeBook in Queue.Active.OfType()) + // Apply to all currently active books. Over a copy: the speed limit is changed from the UI + // thread while book tasks start and finish, and Active is the live list. + foreach (var activeBook in Queue.GetActive().OfType()) activeBook.Configuration.DownloadSpeedLimit = config.DownloadSpeedLimit; SpeedLimitIncrement = _speedLimit > 100 ? 10