X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FSystem.Diagnostics%2FProcess.cs;h=b038095093c5b31d60332cd4de3021c0b11e0787;hb=cfc5d4fb3de1f8c58cc6cc99cbbe6d56070c9cab;hp=59544083c38a96a0a74dbbf4769910302b163f83;hpb=13aeb8836a5c036a7b8918a2e53f58a10475069e;p=mono.git diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs index 59544083c38..b038095093c 100644 --- a/mcs/class/System/System.Diagnostics/Process.cs +++ b/mcs/class/System/System.Diagnostics/Process.cs @@ -482,7 +482,8 @@ namespace System.Diagnostics if (proc == IntPtr.Zero) throw new ArgumentException ("Can't find process with ID " + processId.ToString ()); - return (new Process (new SafeProcessHandle (proc, false), processId)); + /* The handle returned by GetProcess_internal is owned by its caller, so we must pass true to SafeProcessHandle */ + return (new Process (new SafeProcessHandle (proc, true), processId)); } public static Process[] GetProcessesByName(string processName, string machineName)