diff --git a/src/alg_sec.cpp b/src/alg_sec.cpp index d24152f1..f876d100 100644 --- a/src/alg_sec.cpp +++ b/src/alg_sec.cpp @@ -508,8 +508,6 @@ void cls_algsec::params_defaults() /**Load the parms from the config to algsec struct */ void cls_algsec::load_params() { - pthread_mutex_init(&mutex, NULL); - method = cam->cfg->secondary_method; handler_finished = true; image_norm = nullptr; @@ -656,7 +654,7 @@ void cls_algsec::handler_shutdown() } handler_finished = true; } - pthread_mutex_destroy(&mutex); + myfree(image_norm); mydelete(params); @@ -721,6 +719,7 @@ cls_algsec::cls_algsec(cls_camera *p_cam) image_norm = nullptr; params = nullptr; method = "none"; + pthread_mutex_init(&mutex, NULL); handler_startup(); #else (void)p_cam; @@ -731,6 +730,7 @@ cls_algsec::~cls_algsec() { #ifdef HAVE_OPENCV handler_shutdown(); + pthread_mutex_destroy(&mutex); #endif } diff --git a/src/dbse.cpp b/src/dbse.cpp index deef1725..0a0e4456 100644 --- a/src/dbse.cpp +++ b/src/dbse.cpp @@ -1095,6 +1095,7 @@ cls_dbse::cls_dbse(cls_motapp *p_app) app = p_app; pthread_mutex_init(&mutex_dbse, nullptr); + restart = false; pthread_mutex_lock(&mutex_dbse); startup(); diff --git a/src/logger.cpp b/src/logger.cpp index 662fb1d1..192e06e7 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -267,6 +267,7 @@ cls_log::cls_log(cls_motapp *p_app) log_file_ptr = nullptr; log_file_name = ""; flood_cnt = 0; + restart = false; set_mode(LOGMODE_SYSLOG); pthread_mutex_init(&mutex_log, NULL); memset(msg_prefix,0,sizeof(msg_prefix)); diff --git a/src/webu.cpp b/src/webu.cpp index 52e40ece..cf22ea22 100644 --- a/src/webu.cpp +++ b/src/webu.cpp @@ -542,6 +542,7 @@ void cls_webu::shutdown() cls_webu::cls_webu(cls_motapp *p_app) { app = p_app; + restart = false; startup(); }