Ver código fonte

Caller of Exited event should wait for process to exit in background.

Otherwise simply adding an event will make our program to live at least as long
as the created process lives.
Konrad M. Kruczynski 10 anos atrás
pai
commit
e348cf2a80
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      mcs/class/System/System.Diagnostics/Process.cs

+ 1 - 1
mcs/class/System/System.Diagnostics/Process.cs

@@ -1584,7 +1584,7 @@ namespace System.Diagnostics {
 			if (background_wait_for_exit_thread != null)
 				return;
 
-			Thread t = new Thread (_ => WaitForExit ());
+			Thread t = new Thread (_ => WaitForExit ()) { IsBackground = true };
 
 			if (Interlocked.CompareExchange (ref background_wait_for_exit_thread, t, null) == null)
 				t.Start ();