summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-05-26 19:39:32 +0100
committersr55 <[email protected]>2020-05-26 19:39:32 +0100
commitbb1d83baf64706f0ed2211ae376823d16a5fee8a (patch)
tree4b2d98df634241528b6c1b32d08e962ef4c11ada
parent8c4a8cf9a8e81281cd72659e74dcd4f3ae3d2752 (diff)
WinGui: Fix an issue where a deleted queue job can be continued if paused previously. Fixes #2888
-rw-r--r--win/CS/HandBrakeWPF/Services/Queue/QueueService.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
index 94e3ab802..f3228db7a 100644
--- a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
+++ b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
@@ -358,6 +358,21 @@ namespace HandBrakeWPF.Services.Queue
{
lock (QueueLock)
{
+ ActiveJob activeJob = null;
+ foreach (ActiveJob ajob in this.activeJobs)
+ {
+ if (Equals(ajob.Job, job))
+ {
+ activeJob = ajob;
+ ajob.Stop();
+ }
+ }
+
+ if (activeJob != null)
+ {
+ this.activeJobs.Remove(activeJob);
+ }
+
this.queue.Remove(job);
this.InvokeQueueChanged(EventArgs.Empty);
}