OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / frmQueue.cs
index f9f59fe..67251cc 100644 (file)
@@ -73,9 +73,10 @@ namespace Handbrake
 \r
         private void startProc(object state)\r
         {\r
+            // Reminder: There is still a bug here where the loop suddenly halts for no good reson. UpdateUIelements runs, then the loop finishes several items early.\r
             for (int i = 0; i < list_queue.Items.Count; i++)\r
             {\r
-                string query = list_queue.Items[i] as string;\r
+                string query = list_queue.Items[0] as string;\r
                 Process hbProc = new Process();\r
                 hbProc.StartInfo.FileName = "hbcli.exe";\r
                 hbProc.StartInfo.Arguments = query;\r
@@ -108,6 +109,8 @@ namespace Handbrake
 \r
                 hbProc.WaitForExit();\r
                 hbProc.Close();\r
+                hbProc.Dispose();\r
+                \r
 \r
                 updateUIElements();\r
             }\r
@@ -120,7 +123,6 @@ namespace Handbrake
                 this.BeginInvoke(new ProgressUpdateHandler(updateUIElements));\r
                 return;\r
             }\r
-\r
             this.list_queue.Items.RemoveAt(0);\r
             progressBar.PerformStep();\r
             lbl_progressValue.Text = string.Format("{0} %", progressBar.Value);\r