diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 93398d337d..d27757119a 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -231,10 +231,9 @@ void destroyTscObj(void *pObj) { tscDebug("connObj 0x%" PRIx64 " p:%p destroyed, remain inst totalConn:%" PRId64, pTscObj->id, pTscObj, pTscObj->pAppInfo->numOfConns); - int64_t connNum = atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); - if (0 == connNum) { - destroyAppInst(pTscObj->pAppInfo); - } + // In any cases, we should not free app inst here. Or an race condition rise. + /*int64_t connNum = */atomic_sub_fetch_64(&pTscObj->pAppInfo->numOfConns, 1); + taosThreadMutexDestroy(&pTscObj->mutex); taosMemoryFree(pTscObj);