mirror of
https://github.com/isar/libmdbx.git
synced 2025-03-10 07:08:13 +08:00
mdbx: более полная очистка курсоров при закрытии/отключении (backport).
This commit is contained in:
parent
1792bdc763
commit
9277daa185
@ -121,8 +121,8 @@ int mdbx_cursor_unbind(MDBX_cursor *mc) {
|
||||
}
|
||||
mc->next = mc;
|
||||
}
|
||||
be_poor(mc);
|
||||
mc->signature = cur_signature_ready4dispose;
|
||||
mc->flags = 0;
|
||||
return MDBX_SUCCESS;
|
||||
}
|
||||
|
||||
@ -171,6 +171,7 @@ void mdbx_cursor_close(MDBX_cursor *mc) {
|
||||
/* Cursor closed before nested txn ends */
|
||||
tASSERT(txn, mc->signature == cur_signature_live);
|
||||
ENSURE(txn->env, check_txn_rw(txn, 0) == MDBX_SUCCESS);
|
||||
be_poor(mc);
|
||||
mc->signature = cur_signature_wait4eot;
|
||||
}
|
||||
}
|
||||
@ -218,8 +219,8 @@ int mdbx_txn_release_all_cursors(const MDBX_txn *txn, bool unbind) {
|
||||
txn->cursors[i] = mc->next;
|
||||
mc->next = mc;
|
||||
if (unbind) {
|
||||
be_poor(mc);
|
||||
mc->signature = cur_signature_ready4dispose;
|
||||
mc->flags = 0;
|
||||
} else {
|
||||
mc->signature = 0;
|
||||
osal_free(mc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user