summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-02 19:58:53 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-02-02 19:58:53 +0300
commita7c14294ccfc26f48b5e4c511b7dc65b7e3020a9 (patch)
treea0bea7d9b7356231ba344bac2c4327bf1e7e1240 /plugins/Dbx_mdbx
parent3253e019a8fec1dccbd5018a6f6195c248e335bc (diff)
merge with libmdbx
Diffstat (limited to 'plugins/Dbx_mdbx')
-rw-r--r--plugins/Dbx_mdbx/src/libmdbx/src/mdbx.c6
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);
}