mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-09 23:23:34 -04:00
Must join the previous thread before starting a new one or we crash
This commit is contained in:
@@ -10,11 +10,11 @@ DecoderThread::DecoderThread(Monitor *monitor) :
|
||||
|
||||
DecoderThread::~DecoderThread() {
|
||||
Stop();
|
||||
if (thread_.joinable())
|
||||
thread_.join();
|
||||
if (thread_.joinable()) thread_.join();
|
||||
}
|
||||
|
||||
void DecoderThread::Start() {
|
||||
if (thread_.joinable()) thread_.join();
|
||||
terminate_ = false;
|
||||
thread_ = std::thread(&DecoderThread::Run, this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user