1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 15:26:33 -04:00

ADS-B demod: ADSBDemodWorker: check running state before actual start/stop

This commit is contained in:
f4exb 2021-06-05 19:46:39 +02:00
parent ccb7633154
commit 046c066c11

View File

@ -57,6 +57,11 @@ void ADSBDemodWorker::reset()
bool ADSBDemodWorker::startWork()
{
QMutexLocker mutexLocker(&m_mutex);
if (m_running) {
return m_running;
}
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
m_heartbeatTimer.start(60*1000);
m_running = true;
@ -66,6 +71,11 @@ bool ADSBDemodWorker::startWork()
void ADSBDemodWorker::stopWork()
{
QMutexLocker mutexLocker(&m_mutex);
if (!m_running) {
return;
}
m_heartbeatTimer.stop();
disconnect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
m_running = false;