From 13b8ebd7e676dd49e42b7888e0855f20739ceb4e Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Wed, 18 Apr 2012 01:15:05 +0200 Subject: [PATCH] windows: a closing async watcher should not call it's callback --- src/win/async.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/async.c b/src/win/async.c index ee5faea2..b68a8680 100644 --- a/src/win/async.c +++ b/src/win/async.c @@ -118,10 +118,10 @@ void uv_process_async_wakeup_req(uv_loop_t* loop, uv_async_t* handle, assert(req->type == UV_WAKEUP); handle->async_sent = 0; - if (handle->async_cb) { + + if (!(handle->flags & UV_HANDLE_CLOSING)) { handle->async_cb((uv_async_t*) handle, 0); - } - if (handle->flags & UV_HANDLE_CLOSING) { + } else { uv_want_endgame(loop, (uv_handle_t*)handle); } }