diff options
-rw-r--r-- | plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c b/plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c index a8e0500326..b3ce3388d5 100644 --- a/plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c +++ b/plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c @@ -2966,7 +2966,6 @@ static int mdbx_txn_end(MDBX_txn *txn, unsigned mode) { env->me_last_reclaimed = 0; env->me_txn = NULL; - mode = 0; /* txn == env->me_txn0, do not free() it */ /* The writer mutex was locked in mdbx_txn_begin. */ mdbx_txn_unlock(env); @@ -2982,9 +2981,8 @@ static int mdbx_txn_end(MDBX_txn *txn, unsigned mode) { mdbx_pnl_free(pghead); } - mdbx_assert(env, txn->mt_owner == 0); - if (mode & MDBX_END_FREE) { - mdbx_ensure(env, txn != env->me_txn0); + mdbx_assert(env, txn == env->me_txn0 || txn->mt_owner == 0); + if ((mode & MDBX_END_FREE) != 0 && txn != env->me_txn0) { txn->mt_signature = 0; free(txn); } |