From cc143317b1b8cd9560f8955d299f0da80104be90 Mon Sep 17 00:00:00 2001 From: Igor Zinkovsky Date: Fri, 5 Aug 2011 17:41:31 -0700 Subject: [PATCH] windows: fix req refcount for uv_pipe_connect --- src/win/internal.h | 1 + src/win/pipe.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/win/internal.h b/src/win/internal.h index 37836426..a10bba25 100644 --- a/src/win/internal.h +++ b/src/win/internal.h @@ -110,6 +110,7 @@ void uv_process_endgames(); #define DECREASE_PENDING_REQ_COUNT(handle) \ do { \ + assert(handle->reqs_pending > 0); \ handle->reqs_pending--; \ \ if (handle->flags & UV_HANDLE_CLOSING && \ diff --git a/src/win/pipe.c b/src/win/pipe.c index 9b8bdbdd..1f8e2da2 100644 --- a/src/win/pipe.c +++ b/src/win/pipe.c @@ -317,6 +317,8 @@ static DWORD WINAPI pipe_connect_thread_proc(void* parameter) { uv_fatal_error(GetLastError(), "PostQueuedCompletionStatus"); } + handle->reqs_pending++; + return 0; }