diff --git a/source/util/src/tcache.c b/source/util/src/tcache.c index c4e85a425e..a69f11f285 100644 --- a/source/util/src/tcache.c +++ b/source/util/src/tcache.c @@ -910,6 +910,8 @@ void taosCacheRefresh(SCacheObj *pCacheObj, __cache_trav_fn_t fp, void *param1) void taosStopCacheRefreshWorker(void) { stopRefreshWorker = true; + taosThreadJoin(cacheRefreshWorker, NULL); + taosArrayDestroy(pCacheArrayList); } size_t taosCacheGetNumOfObj(const SCacheObj* pCacheObj) {