Merge branch 'master' of github.com:zoneminder/ZoneMinder
This commit is contained in:
commit
79d4f65164
|
@ -9,7 +9,7 @@ AnalysisThread::AnalysisThread(std::shared_ptr<Monitor> monitor) :
|
|||
}
|
||||
|
||||
AnalysisThread::~AnalysisThread() {
|
||||
terminate_ = true;
|
||||
Stop();
|
||||
if (thread_.joinable())
|
||||
thread_.join();
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ class AnalysisThread {
|
|||
AnalysisThread(AnalysisThread &rhs) = delete;
|
||||
AnalysisThread(AnalysisThread &&rhs) = delete;
|
||||
|
||||
void Stop() { terminate_ = true; }
|
||||
|
||||
private:
|
||||
void Run();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue