mdbx-windows: исправление утечки overlapped-дескриптора.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2022-12-10 14:44:15 +03:00
parent cd0ed2f155
commit 1ae6a398ed
2 changed files with 4 additions and 4 deletions

View File

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

View File

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