diff options
author | Jo Shields <directhex@apebox.org> | 2014-02-19 22:12:43 +0000 |
---|---|---|
committer | Jo Shields <directhex@apebox.org> | 2014-02-19 22:12:43 +0000 |
commit | 9972bf87b4f27d9c8f358ef8414ac1ab957a2f0f (patch) | |
tree | 5bb230c1d698659115f918e243c1d4b0aa4c7f51 /mcs/class/System/System.Diagnostics/Process.cs | |
parent | d0a215f5626219ff7927f576588a777e5331c7be (diff) | |
download | mono-upstream/3.2.8+dfsg.tar.gz |
Imported Upstream version 3.2.8+dfsgupstream/3.2.8+dfsg
Diffstat (limited to 'mcs/class/System/System.Diagnostics/Process.cs')
-rw-r--r-- | mcs/class/System/System.Diagnostics/Process.cs | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs index e08d79e0f1..7a63ce0377 100644 --- a/mcs/class/System/System.Diagnostics/Process.cs +++ b/mcs/class/System/System.Diagnostics/Process.cs @@ -918,8 +918,7 @@ namespace System.Diagnostics { IntPtr stderr, ref ProcInfo proc_info); - private static bool Start_shell (ProcessStartInfo startInfo, - Process process) + private static bool Start_shell (ProcessStartInfo startInfo, Process process) { ProcInfo proc_info=new ProcInfo(); bool ret; @@ -948,9 +947,7 @@ namespace System.Diagnostics { process.process_handle = proc_info.process_handle; process.pid = proc_info.pid; - process.StartExitCallbackIfNeeded (); - return(ret); } @@ -1182,9 +1179,9 @@ namespace System.Diagnostics { if (startInfo == null) throw new ArgumentNullException ("startInfo"); - Process process=new Process(); + Process process = new Process(); process.StartInfo = startInfo; - if (Start_common(startInfo, process)) + if (Start_common(startInfo, process) && process.process_handle != IntPtr.Zero) return process; return null; } @@ -1566,6 +1563,21 @@ namespace System.Diagnostics { async_output.Close (); if (async_error != null) async_error.Close (); + + if (input_stream != null) { + input_stream.Close(); + input_stream = null; + } + + if (output_stream != null) { + output_stream.Close(); + output_stream = null; + } + + if (error_stream != null) { + error_stream.Close(); + error_stream = null; + } } } @@ -1576,21 +1588,6 @@ namespace System.Diagnostics { Process_free_internal(process_handle); process_handle=IntPtr.Zero; } - - if (input_stream != null) { - input_stream.Close(); - input_stream = null; - } - - if (output_stream != null) { - output_stream.Close(); - output_stream = null; - } - - if (error_stream != null) { - error_stream.Close(); - error_stream = null; - } } } base.Dispose (disposing); |