From 1ae6a398edba34bcae875f9a58e2a7909ad94cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sat, 10 Dec 2022 14:44:15 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-windows:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=83=D1=82=D0=B5=D1=87?= =?UTF-8?q?=D0=BA=D0=B8=20overlapped-=D0=B4=D0=B5=D1=81=D0=BA=D1=80=D0=B8?= =?UTF-8?q?=D0=BF=D1=82=D0=BE=D1=80=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core.c | 6 ++---- src/osal.c | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core.c b/src/core.c index db00fc66..0c3d7cbc 100644 --- a/src/core.c +++ b/src/core.c @@ -14877,10 +14877,8 @@ __cold static int env_close(MDBX_env *env) { } #if defined(_WIN32) || defined(_WIN64) - if (env->me_overlapped_fd) { - CloseHandle(env->me_overlapped_fd); - env->me_overlapped_fd = 0; - } + eASSERT(env, !env->me_overlapped_fd || + env->me_overlapped_fd == INVALID_HANDLE_VALUE); if (env->me_data_lock_event != INVALID_HANDLE_VALUE) { CloseHandle(env->me_data_lock_event); env->me_data_lock_event = INVALID_HANDLE_VALUE; diff --git a/src/osal.c b/src/osal.c index 69a0b49f..91276c66 100644 --- a/src/osal.c +++ b/src/osal.c @@ -1155,6 +1155,8 @@ MDBX_INTERNAL_FUNC void osal_ioring_destroy(osal_ioring_t *ior) { osal_memalign_free(ior->pool); osal_free(ior->event_pool); CloseHandle(ior->async_done); + if (ior->overlapped_fd) + CloseHandle(ior->overlapped_fd); #else osal_free(ior->pool); #endif