OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 11 Nov 2010 12:26:34 +0000 (12:26 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 11 Nov 2010 12:26:34 +0000 (12:26 +0000)
- Remove some code that has been causing a crash after encoding has completed.

git-svn-id: svn://localhost/HandBrake/trunk@3673 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/HandBrake.ApplicationServices/Services/Encode.cs
win/C#/HandBrake.Framework/Services/ErrorService.cs
win/C#/HandBrake.Framework/Services/Interfaces/IErrorService.cs

index 9e5d7be..5e75271 100644 (file)
@@ -110,11 +110,6 @@ namespace HandBrake.ApplicationServices.Services
         protected Process HbProcess { get; set; }\r
 \r
         /// <summary>\r
-        /// Determines if the process was killed or safely closed.\r
-        /// </summary>\r
-        private bool processKilled;\r
-\r
-        /// <summary>\r
         /// Gets a value indicating whether IsEncoding.\r
         /// </summary>\r
         public bool IsEncoding { get; private set; }\r
@@ -339,12 +334,6 @@ namespace HandBrake.ApplicationServices.Services
         /// </param>\r
         private void HbProcess_Exited(object sender, EventArgs e)\r
         {\r
-            if (HbProcess != null && HbProcess.HasExited && HbProcess.ExitCode != 0 && !processKilled)\r
-            {\r
-                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));\r
-            }\r
-\r
-            processKilled = false;\r
             IsEncoding = false;\r
             if (this.EncodeEnded != null)\r
                 this.EncodeEnded(this, new EventArgs());\r
index 4137264..3858f16 100644 (file)
@@ -35,7 +35,7 @@ namespace HandBrake.Framework.Services
 \r
             try\r
             {\r
-                Thread newThread = new Thread(new ParameterizedThreadStart(WriteExceptionToFile));\r
+                Thread newThread = new Thread(new ParameterizedThreadStart(this.LogError));\r
                 newThread.Start(shortError + Environment.NewLine + longError);\r
             }\r
             catch (Exception)\r
@@ -78,7 +78,7 @@ namespace HandBrake.Framework.Services
         /// <param name="state">\r
         /// The state.\r
         /// </param>\r
-        public void WriteExceptionToFile(object state)\r
+        public void LogError(object state)\r
         {\r
             try\r
             {\r
index 86d6f02..9eceead 100644 (file)
@@ -31,5 +31,11 @@ namespace HandBrake.Framework.Services.Interfaces
         /// Is a warning window, show the warning icon instead of the notice\r
         /// </param>\r
         void ShowNotice(string notice, bool isWarning);\r
+\r
+        /// <summary>\r
+        /// Log the error\r
+        /// </summary>\r
+        /// <param name="state">The error message</param>\r
+        void LogError(object state);\r
     }\r
 }
\ No newline at end of file