From 4affa39380b06ffae790419edfc4a8d1286e8dac Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 9 Nov 2010 18:02:22 +0000 Subject: 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 --- win/C#/HandBrake.ApplicationServices/Services/Encode.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'win/C#/HandBrake.ApplicationServices') 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 /// protected Process HbProcess { get; set; } + private bool processKilled; + /// /// Gets a value indicating whether IsEncoding. /// @@ -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 /// 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)); } -- cgit v1.2.3