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) {