mdbx: fix mdbx_env_close_ex() for MDBX_RDONLY.

Change-Id: I5ff79a93e026d4b40412294956dd222081a1b821
This commit is contained in:
Leo Yuriev 2017-07-24 15:04:54 +03:00
parent ab8fa36033
commit 94af9e02b0

View File

@ -5123,8 +5123,8 @@ int __cold mdbx_env_close_ex(MDBX_env *env, int dont_sync) {
if (unlikely(env->me_signature != MDBX_ME_SIGNATURE))
return MDBX_EBADSIGN;
if (!dont_sync && env->me_lck)
rc = mdbx_env_sync(env, 1);
if (!dont_sync && !(env->me_flags & MDBX_RDONLY))
rc = mdbx_env_sync(env, true);
VALGRIND_DESTROY_MEMPOOL(env);
while ((dp = env->me_dpages) != NULL) {