applied patch from bug #260588
[mono.git] / mcs / class / System / System.Diagnostics / Process.cs
index aed5bf929a13824620925b8e4210de9ae136948c..d2d510c1c081ed10139458eede19351f9662b833 100644 (file)
@@ -1403,7 +1403,7 @@ namespace System.Diagnostics {
                                                completed = true;
                                                if (wait_handle != null)
                                                        wait_handle.Set ();
-                                               Flush (true);
+                                               FlushLast ();
                                                return;
                                        }
 
@@ -1421,6 +1421,16 @@ namespace System.Diagnostics {
                                }
                        }
 
+                       void FlushLast ()
+                       {
+                               Flush (true);
+                               if (err_out) {
+                                       process.OnOutputDataReceived (null);
+                               } else {
+                                       process.OnErrorDataReceived (null);
+                               }
+                       }
+                       
                        void Flush (bool last)
                        {
                                if (sb.Length == 0 ||