From 14c06cd2d4593eec435f0fd9211f55efb2f4ceef Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 31 Jan 2021 11:44:25 -0500 Subject: [PATCH] Close monitor after terminating threads instead of before --- src/zmc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zmc.cpp b/src/zmc.cpp index 5a2eb108e..c7b5d29ac 100644 --- a/src/zmc.cpp +++ b/src/zmc.cpp @@ -403,9 +403,6 @@ int main(int argc, char *argv[]) { #endif } - for ( int i = 0; i < n_monitors; i++ ) { - monitors[i]->Close(); - } // Killoff the analysis threads. Don't need them spinning while we try to reconnect for ( int i = 0; i < n_monitors; i++ ) { if ( analysis_threads[i] ) { @@ -426,6 +423,9 @@ int main(int argc, char *argv[]) { rtsp_server_threads = nullptr; } #endif + for ( int i = 0; i < n_monitors; i++ ) { + monitors[i]->Close(); + } delete [] alarm_capture_delays; delete [] capture_delays; delete [] last_capture_times;