summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-11-09 18:02:22 +0000
committersr55 <[email protected]>2010-11-09 18:02:22 +0000
commit4affa39380b06ffae790419edfc4a8d1286e8dac (patch)
treeb4ada89c3ee08f327ac02b214bba44954cd88f70 /win
parent2ac75a70d17f26b7efcf8f84a1b1c6f3049904ad (diff)
WinGui:
- Don't display an exception after the process was deliberately killed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3666 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/C#/HandBrake.ApplicationServices/Services/Encode.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
index e4c09793b..3e0e31e11 100644
--- a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
+++ b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs
@@ -109,6 +109,8 @@ namespace HandBrake.ApplicationServices.Services
/// </summary>
protected Process HbProcess { get; set; }
+ private bool processKilled;
+
/// <summary>
/// Gets a value indicating whether IsEncoding.
/// </summary>
@@ -242,7 +244,11 @@ namespace HandBrake.ApplicationServices.Services
{
try
{
- if (this.HbProcess != null && !this.HbProcess.HasExited) this.HbProcess.Kill();
+ if (this.HbProcess != null && !this.HbProcess.HasExited)
+ {
+ processKilled = true;
+ this.HbProcess.Kill();
+ }
}
catch (Exception exc)
{
@@ -330,7 +336,7 @@ namespace HandBrake.ApplicationServices.Services
/// </param>
private void HbProcess_Exited(object sender, EventArgs e)
{
- if (HbProcess != null && HbProcess.HasExited && HbProcess.ExitCode != 0)
+ if (HbProcess != null && HbProcess.HasExited && HbProcess.ExitCode != 0 && !processKilled)
{
errorService.ShowError("It appears that HandBrakeCLI has crashed. You can check the Activity Log for further information.", string.Format("Exit Code was: {0}", HbProcess.ExitCode));
}