mdbx: fix/don't clean env-signature if open failed.

This commit is contained in:
Leonid Yuriev 2020-05-06 20:04:33 +03:00
parent b67f2da821
commit db635c9fbb

View File

@ -10257,7 +10257,6 @@ static int __cold mdbx_env_close0(MDBX_env *env) {
return MDBX_SUCCESS; return MDBX_SUCCESS;
} }
env->me_signature = 0;
env->me_flags &= ~MDBX_ENV_ACTIVE; env->me_flags &= ~MDBX_ENV_ACTIVE;
env->me_oldest = nullptr; env->me_oldest = nullptr;
env->me_sync_timestamp = nullptr; env->me_sync_timestamp = nullptr;
@ -10370,6 +10369,7 @@ int __cold mdbx_env_close_ex(MDBX_env *env, int dont_sync) {
#endif #endif
} }
env->me_signature = 0;
rc = mdbx_env_close0(env) ? MDBX_PANIC : rc; rc = mdbx_env_close0(env) ? MDBX_PANIC : rc;
mdbx_ensure(env, mdbx_fastmutex_destroy(&env->me_dbi_lock) == MDBX_SUCCESS); mdbx_ensure(env, mdbx_fastmutex_destroy(&env->me_dbi_lock) == MDBX_SUCCESS);
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)