Merge pull request #24602 from taosdata/fix/3.0/TD-28398

fix: tcache conn obj ref count not released
This commit is contained in:
dapan1121 2024-01-29 10:10:44 +08:00 committed by GitHub
commit b2041fa3ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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) {
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);
}