changeset 40928:576474baa209

win32: close the handles associated with a spawned child process Probably not a big deal because at this point, the call is only used when spawning a daemonized server. In that case, the parent process goes away first, so it won't prevent the child from being cleaned up.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 11 Dec 2018 21:57:54 -0500
parents c9c10430fd7f
children 43ca24b772d6
files mercurial/win32.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/win32.py	Tue Dec 11 22:23:39 2018 +0900
+++ b/mercurial/win32.py	Tue Dec 11 21:57:54 2018 -0500
@@ -588,6 +588,9 @@
     if not res:
         raise ctypes.WinError()
 
+    _kernel32.CloseHandle(pi.hProcess)
+    _kernel32.CloseHandle(pi.hThread)
+
     return pi.dwProcessId
 
 def unlink(f):