From cc45d7a6f3195d7651668323c56c9cb549d09efc Mon Sep 17 00:00:00 2001 From: wangjiaming0909 <604227650@qq.com> Date: Tue, 23 Jan 2024 15:35:27 +0800 Subject: [PATCH] fix: tcache conn obj ref count not released --- source/util/src/tcache.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/util/src/tcache.c b/source/util/src/tcache.c index 11f8df4c93..0a7842194e 100644 --- a/source/util/src/tcache.c +++ b/source/util/src/tcache.c @@ -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); }