mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 12:51:49 -05:00
ADS-B demod: ADSBDemodWorker: check running state before actual start/stop
This commit is contained in:
parent
ccb7633154
commit
046c066c11
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user