Merge branch 'master' of github.com:zoneminder/ZoneMinder

This commit is contained in:
Isaac Connor 2021-02-11 11:50:09 -05:00
commit 79d4f65164
3 changed files with 8 additions and 3 deletions

View File

@ -9,7 +9,7 @@ AnalysisThread::AnalysisThread(std::shared_ptr<Monitor> monitor) :
}
AnalysisThread::~AnalysisThread() {
terminate_ = true;
Stop();
if (thread_.joinable())
thread_.join();
}

View File

@ -13,6 +13,8 @@ class AnalysisThread {
AnalysisThread(AnalysisThread &rhs) = delete;
AnalysisThread(AnalysisThread &&rhs) = delete;
void Stop() { terminate_ = true; }
private:
void Run();

View File

@ -384,8 +384,8 @@ int main(int argc, char *argv[]) {
} // end if zm_reload
} // end while ! zm_terminate and connected
// Killoff the analysis threads. Don't need them spinning while we try to reconnect
analysis_threads.clear();
for (std::unique_ptr<AnalysisThread> &analysis_thread: analysis_threads)
analysis_thread->Stop();
for (size_t i = 0; i < monitors.size(); i++) {
#if HAVE_RTSP_SERVER
@ -408,6 +408,9 @@ int main(int argc, char *argv[]) {
camera->Close();
}
// Killoff the analysis threads. Don't need them spinning while we try to reconnect
analysis_threads.clear();
#if HAVE_RTSP_SERVER
if (rtsp_server_threads) {
delete[] rtsp_server_threads;