Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
win: Fix crash when calling uv_close from shutdown callback
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed Sep 27, 2011
1 parent bdac72c commit 2c0fca9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/win/pipe.c
Expand Up @@ -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. */
Expand Down
4 changes: 3 additions & 1 deletion src/win/tcp.c
Expand Up @@ -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 &&
Expand Down

0 comments on commit 2c0fca9

Please sign in to comment.