Skip to content

Commit

Permalink
WinGui: Fix a deadlock that can occur in the queue window when a stop…
Browse files Browse the repository at this point in the history
… task is defined. HandBrake#4782
  • Loading branch information
sr55 committed Dec 31, 2022
1 parent 77e3cd7 commit f0cc281
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ public void Add(QueueTask job)
lock (QueueLock)
{
this.queue.Add(job);
this.InvokeQueueChanged(EventArgs.Empty);
}

this.InvokeQueueChanged(EventArgs.Empty);
}

public void Add(List<QueueTask> tasks)
Expand All @@ -154,9 +155,9 @@ public void Add(List<QueueTask> tasks)
{
this.queue.Add(job);
}

this.InvokeQueueChanged(EventArgs.Empty);
}

this.InvokeQueueChanged(EventArgs.Empty);
}

public void BackupQueue(string exportPath)
Expand Down Expand Up @@ -448,9 +449,9 @@ public void Remove(QueueTask job)
{
this.IsPaused = false;
}

this.InvokeQueueChanged(EventArgs.Empty);
}

this.InvokeQueueChanged(EventArgs.Empty);
}

public void RestoreQueue(string importPath)
Expand Down Expand Up @@ -821,13 +822,14 @@ private void HandleBreakPoint(QueueTask task)

// Remove the Breakpoint
ThreadHelper.OnUIThread(() => this.queue.Remove(task));
}

this.IsProcessing = false;
this.IsPaused = false;

// Setting the flag will allow or prevent the when done actions to be processed.
this.InvokeQueueCompleted(new QueueCompletedEventArgs(false));
}
this.IsProcessing = false;
this.IsPaused = false;

// Setting the flag will allow or prevent the when done actions to be processed.
this.InvokeQueueCompleted(new QueueCompletedEventArgs(false));
}

private void RemoveBreakPoints()
Expand Down

0 comments on commit f0cc281

Please sign in to comment.