mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-11-30 02:01:03 +01:00
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.
This commit is contained in:
@@ -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<ProcessBookViewModel>())
|
||||
// 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<ProcessBookViewModel>())
|
||||
activeBook.Configuration.DownloadSpeedLimit = config.DownloadSpeedLimit;
|
||||
|
||||
SpeedLimitIncrement = _speedLimit > 100 ? 10
|
||||
|
||||
Reference in New Issue
Block a user