fix(tdb/btc): free txn early when closing btc

This commit is contained in:
Minglei Jin 2024-04-29 15:23:00 +08:00
parent 511e0de155
commit d5f140aee2
1 changed files with 4 additions and 4 deletions

View File

@ -2473,6 +2473,10 @@ int tdbBtcMoveTo(SBTC *pBtc, const void *pKey, int kLen, int *pCRst) {
}
int tdbBtcClose(SBTC *pBtc) {
if (pBtc->freeTxn) {
tdbTxnClose(pBtc->pTxn);
}
if (pBtc->iPage < 0) return 0;
for (;;) {
@ -2496,10 +2500,6 @@ int tdbBtcClose(SBTC *pBtc) {
tdbFree(pBtc->coder.pVal);
}
if (pBtc->freeTxn) {
tdbTxnClose(pBtc->pTxn);
}
return 0;
}