From ed58af2512fb3a39647945e461dcfe91652e5def Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 25 Aug 2019 05:20:20 +0300 Subject: [PATCH] mdbx-posix: minor fix mdbx_lck_destroy(). --- src/lck-posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lck-posix.c b/src/lck-posix.c index 016c3337..c8ecec0e 100644 --- a/src/lck-posix.c +++ b/src/lck-posix.c @@ -265,8 +265,8 @@ void __cold mdbx_lck_destroy(MDBX_env *env) { * locks should be released here explicitly with properly order. */ if (env->me_lfd != INVALID_HANDLE_VALUE) (void)mdbx_lck_op(env->me_lfd, OP_SETLK, F_UNLCK, 0, OFF_T_MAX); - assert(env->me_fd != INVALID_HANDLE_VALUE); - (void)mdbx_lck_op(env->me_fd, OP_SETLK, F_UNLCK, 0, OFF_T_MAX); + if (env->me_fd != INVALID_HANDLE_VALUE) + (void)mdbx_lck_op(env->me_fd, OP_SETLK, F_UNLCK, 0, OFF_T_MAX); } static int mdbx_robust_lock(MDBX_env *env, pthread_mutex_t *mutex) {