fix: tcache conn obj ref count not released

This commit is contained in:
wangjiaming0909 2024-01-23 15:35:27 +08:00
parent a518cba133
commit cc45d7a6f3
1 changed files with 6 additions and 0 deletions

View File

@ -994,6 +994,12 @@ void *taosCacheIterGetKey(const SCacheIter *pIter, size_t *len) {
} }
void taosCacheDestroyIter(SCacheIter *pIter) { void taosCacheDestroyIter(SCacheIter *pIter) {
for (int32_t i = 0; i < pIter->numOfObj; ++i) {
if (!pIter->pCurrent[i]) continue;
char *p = pIter->pCurrent[i]->data;
taosCacheRelease(pIter->pCacheObj, (void **)&p, false);
pIter->pCurrent[i] = NULL;
}
taosMemoryFreeClear(pIter->pCurrent); taosMemoryFreeClear(pIter->pCurrent);
taosMemoryFreeClear(pIter); taosMemoryFreeClear(pIter);
} }