diff --git a/src/win/pipe.c b/src/win/pipe.c index 9865e3a8..8d789153 100644 --- a/src/win/pipe.c +++ b/src/win/pipe.c @@ -231,6 +231,7 @@ void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle) { if (result) { /* Mark the handle as shut now to avoid going through this again. */ handle->flags |= UV_HANDLE_SHUT; + return; } else { /* Failure. */ diff --git a/src/win/tcp.c b/src/win/tcp.c index ebd83534..783d5fb9 100644 --- a/src/win/tcp.c +++ b/src/win/tcp.c @@ -128,7 +128,9 @@ void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle) { } handle->shutdown_req->cb(handle->shutdown_req, status); } - handle->reqs_pending--; + + DECREASE_PENDING_REQ_COUNT(handle); + return; } if (handle->flags & UV_HANDLE_CLOSING &&