mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-09-12 21:57:19 -04: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:
1 parent
325af3a491
commit
2b7214e3dd
1 file changed
+3
-2
@@ -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