释放全局变量log_cls*

This commit is contained in:
gb 2023-08-07 15:16:03 +08:00
parent 800dc1f5d3
commit 75559888de
1 changed files with 10 additions and 1 deletions

View File

@ -28,7 +28,7 @@
#include <algorithm>
#include <mutex>
#include "ini_file.h"
#define VMRSS_LINE 21 //实际物理内存使用率
#define VMRSS_LINE 21 //实际物ç<EFBFBD>†å†…存使用çŽ?
#define MAX_LOG_FILE_SIZE 10 * 1024 * 1024
#ifdef _INTSIZEOF
#undef _INTSIZEOF
@ -121,6 +121,14 @@ public:
return log_cls::inst_;
}
static void clear(void)
{
if (log_cls::inst_)
{
delete log_cls::inst_;
log_cls::inst_ = nullptr;
}
}
int set_log_type(int type, void* param)
{
@ -730,6 +738,7 @@ extern "C"
std::string now(log_cls::g_time_tag + hg_log::current_time() + log_cls::g_time_tag + " exited.\n");
log(now.c_str());
log((log_divider + "\n\n\n\n").c_str());
log_cls::clear();
}
void log(int level, const char* info)
{