diff --git a/src/api-cursor.c b/src/api-cursor.c index a10e09ef..f58d37f5 100644 --- a/src/api-cursor.c +++ b/src/api-cursor.c @@ -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);