From 79ffb5e5af9f71476c63d77a60e61061c7a74f03 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Fri, 1 Apr 2022 16:11:51 +0800 Subject: [PATCH] [TD-13756]: file close memory error. --- source/util/src/tlog.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index d74bb11d73..ef15f44f8f 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -103,7 +103,6 @@ static void *taosAsyncOutputLog(void *param); static int32_t taosPushLogBuffer(SLogBuff *tLogBuff, const char *msg, int32_t msgLen); static SLogBuff *taosLogBuffNew(int32_t bufSize); static void taosCloseLogByFd(TdFilePtr pFile); -static void taosDestroyLog(); static int32_t taosOpenLogFile(char *fn, int32_t maxLines, int32_t maxFileNum); static int32_t taosCompressFile(char *srcFileName, char *destFileName); @@ -127,7 +126,6 @@ int32_t taosInitLog(const char *logName, int32_t maxFiles) { tsLogObj.logHandle = taosLogBuffNew(LOG_DEFAULT_BUF_SIZE); if (tsLogObj.logHandle == NULL) return -1; if (taosOpenLogFile(fullName, tsNumOfLogLines, maxFiles) < 0) return -1; - // atexit(taosDestroyLog); if (taosStartLog() < 0) return -1; return 0; } @@ -150,14 +148,6 @@ void taosCloseLog() { // taosCloseLog(); } -static void taosDestroyLog() { - if(tsLogObj.logHandle != NULL) { - taosCloseFile(&tsLogObj.logHandle->pFile); - taosMemoryFreeClear(LOG_BUF_BUFFER(tsLogObj.logHandle)); - taosMemoryFreeClear(tsLogObj.logHandle); - } -} - static bool taosLockLogFile(TdFilePtr pFile) { if (pFile == NULL) return false; -- GitLab