Close monitor after terminating threads instead of before

pull/3122/head
Isaac Connor 2021-01-31 11:44:25 -05:00
parent e237719d6a
commit 14c06cd2d4
1 changed files with 3 additions and 3 deletions

View File

@ -403,9 +403,6 @@ int main(int argc, char *argv[]) {
#endif #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 // Killoff the analysis threads. Don't need them spinning while we try to reconnect
for ( int i = 0; i < n_monitors; i++ ) { for ( int i = 0; i < n_monitors; i++ ) {
if ( analysis_threads[i] ) { if ( analysis_threads[i] ) {
@ -426,6 +423,9 @@ int main(int argc, char *argv[]) {
rtsp_server_threads = nullptr; rtsp_server_threads = nullptr;
} }
#endif #endif
for ( int i = 0; i < n_monitors; i++ ) {
monitors[i]->Close();
}
delete [] alarm_capture_delays; delete [] alarm_capture_delays;
delete [] capture_delays; delete [] capture_delays;
delete [] last_capture_times; delete [] last_capture_times;