fix: free thread save memory before set null

This commit is contained in:
Alex Duan 2023-02-17 14:44:00 +08:00
parent 4a8d5355a7
commit bdfb342ec8
1 changed files with 3 additions and 0 deletions

View File

@ -788,6 +788,9 @@ int writeVarNames(int type, TAOS_RES* tres) {
void setThreadNull(int type) {
taosThreadMutexLock(&tiresMutex);
if(threads[type]) {
taosMemoryFree(threads[type]);
}
threads[type] = NULL;
taosThreadMutexUnlock(&tiresMutex);
}