fix(tdb/btc): free txn early when closing btc
This commit is contained in:
parent
511e0de155
commit
d5f140aee2
|
@ -2473,6 +2473,10 @@ int tdbBtcMoveTo(SBTC *pBtc, const void *pKey, int kLen, int *pCRst) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int tdbBtcClose(SBTC *pBtc) {
|
int tdbBtcClose(SBTC *pBtc) {
|
||||||
|
if (pBtc->freeTxn) {
|
||||||
|
tdbTxnClose(pBtc->pTxn);
|
||||||
|
}
|
||||||
|
|
||||||
if (pBtc->iPage < 0) return 0;
|
if (pBtc->iPage < 0) return 0;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -2496,10 +2500,6 @@ int tdbBtcClose(SBTC *pBtc) {
|
||||||
tdbFree(pBtc->coder.pVal);
|
tdbFree(pBtc->coder.pVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pBtc->freeTxn) {
|
|
||||||
tdbTxnClose(pBtc->pTxn);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue