mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-21 22:08:20 +08:00
mdbx: fix write-txn thread cleanup.
This commit is contained in:
parent
318646794e
commit
3bf3a08f96
@ -2621,6 +2621,7 @@ static int mdbx_txn_end(MDBX_txn *txn, unsigned mode) {
|
|||||||
env->me_pglast = 0;
|
env->me_pglast = 0;
|
||||||
|
|
||||||
env->me_txn = NULL;
|
env->me_txn = NULL;
|
||||||
|
txn->mt_signature = 0;
|
||||||
mode = 0; /* txn == env->me_txn0, do not free() it */
|
mode = 0; /* txn == env->me_txn0, do not free() it */
|
||||||
|
|
||||||
/* The writer mutex was locked in mdbx_txn_begin. */
|
/* The writer mutex was locked in mdbx_txn_begin. */
|
||||||
@ -2638,8 +2639,8 @@ static int mdbx_txn_end(MDBX_txn *txn, unsigned mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mode & MDBX_END_FREE) {
|
if (mode & MDBX_END_FREE) {
|
||||||
|
mdbx_ensure(env, txn != env->me_txn0);
|
||||||
txn->mt_signature = 0;
|
txn->mt_signature = 0;
|
||||||
if (txn != env->me_txn0)
|
|
||||||
free(txn);
|
free(txn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user