提交 79ffb5e5 编写于 作者: wafwerar's avatar wafwerar

[TD-13756]<fix>: file close memory error.

上级 70170d95
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册