win: Fix crash when calling uv_close from shutdown callback

This commit is contained in:
Bert Belder 2011-09-27 19:11:42 +02:00
parent bdac72cc93
commit 2c0fca9a41
2 changed files with 4 additions and 1 deletions

View File

@ -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. */

View File

@ -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 &&