From: Erik Faye-Lund Date: Wed, 03 Nov 2010 22:39:34 GMT Subject: Re: [PATCH v6 00/16] daemon-win32 Message-ID: In-Reply-To: On Wed, Nov 3, 2010 at 11:18 PM, Erik Faye-Lund wrote: > Ah, thanks. For me it's leaking a variable amount of handles per > ls-remote, but if I apply the following patch it's down to one. Need > to find that one as well... > > diff --git a/compat/mingw.c b/compat/mingw.c > index b780200..47e7d26 100644 > --- a/compat/mingw.c > +++ b/compat/mingw.c > @@ -1519,8 +1519,10 @@ pid_t waitpid(pid_t pid, int *status, unsigned options) >        } > >        if (pid > 0 && options & WNOHANG) { > -               if (WAIT_OBJECT_0 != WaitForSingleObject((HANDLE)pid, 0)) > +               if (WAIT_OBJECT_0 != WaitForSingleObject((HANDLE)pid, 0)) { AAAND the last one is right here as well: - if (WAIT_OBJECT_0 != WaitForSingleObject((HANDLE)pid, 0)) + if (WAIT_OBJECT_0 != WaitForSingleObject(h, 0)) {