summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author崔一鸣 <[email protected]>2018-08-13 10:07:44 +0800
committer崔一鸣 <[email protected]>2018-08-13 10:07:44 +0800
commit409387b48bd5b3121414e88bc47acd6cab162006 (patch)
tree5c76eaefd3a658bb8b5511b1db75611820f74812
parent8b9360155b2637999211bb704540d83a3342af50 (diff)
fix bugsHEADmaster
-rw-r--r--src/MESA_handle_logger.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/MESA_handle_logger.c b/src/MESA_handle_logger.c
index 83ee2c7..e0b8a08 100644
--- a/src/MESA_handle_logger.c
+++ b/src/MESA_handle_logger.c
@@ -55,7 +55,7 @@ void* MESA_create_runtime_log_handle(const char *file_path, int level){
el::Loggers::addFlag(el::LoggingFlag::DisableApplicationAbortOnFatalLog);
std::string logger_id = get_logger_id_by_hash(file_path);
el::Logger* logger = el::Loggers::getLogger(logger_id);
- el::Configurations* default_conf = new el::Configurations();
+ el::Configurations* default_conf = new el::Configurations();
void* handle = NULL;
char* conf_file_path = getenv("MESA_HANDLE_LOGGER_CONF_PATH");
if(conf_file_path == NULL){
@@ -149,6 +149,7 @@ int MESA_read_runtime_log_handle_conf(void* handle, const char* conf_file_path){
return -1;
}
struct runtime_log_handle* handle1 = (struct runtime_log_handle*)handle;
+ delete(handle1->conf);
el::Configurations* conf = new el::Configurations(conf_file_path);
handle1->conf = conf;
el::Loggers::reconfigureLogger(handle1->logger, *(handle1->conf));
@@ -204,10 +205,10 @@ void MESA_handle_runtime_log(void* handle, int level, const char* module, const
void MESA_destroy_runtime_log_handle(void* handle){
if(handle != NULL){
- struct runtime_log_handle* handle1 = (struct runtime_log_handle*)handle;
- el::Configurations* conf = handle1->conf;
- delete(conf);
- free(handle);
+ struct runtime_log_handle* handle1 = (struct runtime_log_handle*)handle;
+ el::Configurations* conf = handle1->conf;
+ delete(conf);
+ free(handle);
handle = NULL;
}
return;