diff --git a/src/util/src/tlog.c b/src/util/src/tlog.c index 64679a3fa36afcce63bbb3b0015a43a18a904d0f..8183dd74024f43bced4f02e3df43e8454e5be78a 100644 --- a/src/util/src/tlog.c +++ b/src/util/src/tlog.c @@ -110,7 +110,7 @@ void taosStopLog() { void taosCloseLogger() { taosStopLog(); sem_post(&(logHandle->buffNotEmpty)); - pthread_join(logHandle->asyncThread, NULL); + if (logHandle->asyncThread) pthread_join(logHandle->asyncThread, NULL); // In case that other threads still use log resources causing invalid write in // valgrind, we comment two lines below. // taosLogBuffDestroy(logHandle);