summaryrefslogtreecommitdiff
path: root/Utilities/cmlibuv/src/win/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmlibuv/src/win/core.c')
-rw-r--r--Utilities/cmlibuv/src/win/core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Utilities/cmlibuv/src/win/core.c b/Utilities/cmlibuv/src/win/core.c
index e9d0a58153..6ded90cdcc 100644
--- a/Utilities/cmlibuv/src/win/core.c
+++ b/Utilities/cmlibuv/src/win/core.c
@@ -321,8 +321,13 @@ void uv__loop_close(uv_loop_t* loop) {
uv__loops_remove(loop);
- /* close the async handle without needing an extra loop iteration */
- assert(!loop->wq_async.async_sent);
+ /* Close the async handle without needing an extra loop iteration.
+ * We might have a pending message, but we're just going to destroy the IOCP
+ * soon, so we can just discard it now without the usual risk of a getting
+ * another notification from GetQueuedCompletionStatusEx after calling the
+ * close_cb (which we also skip defining). We'll assert later that queue was
+ * actually empty and all reqs handled. */
+ loop->wq_async.async_sent = 0;
loop->wq_async.close_cb = NULL;
uv__handle_closing(&loop->wq_async);
uv__handle_close(&loop->wq_async);