From 5f7ee42c95caf6c33c266dd815fdb9e2a685ae46 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Mon, 15 Jul 2019 10:07:59 +0800 Subject: [PATCH] Don't SEGFAULT --- src/util/src/tlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/src/tlog.c b/src/util/src/tlog.c index 64679a3fa3..8183dd7402 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); -- GitLab