From 75559888deb0912cd4e7c88947cd9eb26e292526 Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Mon, 7 Aug 2023 15:16:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8A=E6=94=BE=E5=85=A8=E5=B1=80=E5=8F=98?= =?UTF-8?q?=E9=87=8Flog=5Fcls*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/wrapper/hg_log.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hgdriver/wrapper/hg_log.cpp b/hgdriver/wrapper/hg_log.cpp index 4606f3f..3cfd24c 100644 --- a/hgdriver/wrapper/hg_log.cpp +++ b/hgdriver/wrapper/hg_log.cpp @@ -28,7 +28,7 @@ #include #include #include "ini_file.h" -#define VMRSS_LINE 21 //实际物理内存使用率 +#define VMRSS_LINE 21 //实际物理内存使用? #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) {