# HG changeset patch # User Matt Harbison # Date 2018-12-12 02:57:54 # Node ID 576474baa209e69cd2fd94b2b6982ff04325dd2c # Parent c9c10430fd7f1c20ec0c3e2f09391e8ea71db709 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. diff --git a/mercurial/win32.py b/mercurial/win32.py --- a/mercurial/win32.py +++ b/mercurial/win32.py @@ -588,6 +588,9 @@ def spawndetached(args): if not res: raise ctypes.WinError() + _kernel32.CloseHandle(pi.hProcess) + _kernel32.CloseHandle(pi.hThread) + return pi.dwProcessId def unlink(f):