Must join the previous thread before starting a new one or we crash

This commit is contained in:
Isaac Connor committed 2021-04-17 12:50:26 -04:00
1 parent c479c6d68f
commit 1d034b16dd
2 files changed
+5 -6

No files matched your search

+2 -2
View File
@@ -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);
}