1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-09-02 13:17:48 -04:00

TestSource: moved timer start/stop to constructor/destructor. Fixes issue #661

This commit is contained in:
f4exb 2020-11-01 10:48:47 +01:00
parent ef1a7ef8d2
commit edb9defdf6

View File

@ -65,26 +65,26 @@ TestSourceWorker::TestSourceWorker(SampleSinkFifo* sampleFifo, QObject* parent)
m_histoCounter(0) m_histoCounter(0)
{ {
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
m_timer.start(50);
} }
TestSourceWorker::~TestSourceWorker() TestSourceWorker::~TestSourceWorker()
{ {
m_timer.stop();
disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
} }
void TestSourceWorker::startWork() void TestSourceWorker::startWork()
{ {
qDebug("TestSourceWorker::startWork"); qDebug("TestSourceWorker::startWork");
m_timer.setTimerType(Qt::PreciseTimer); m_timer.setTimerType(Qt::PreciseTimer);
connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
m_timer.start(50);
m_running = true; m_running = true;
} }
void TestSourceWorker::stopWork() void TestSourceWorker::stopWork()
{ {
qDebug("TestSourceWorker::stopWork"); qDebug("TestSourceWorker::stopWork");
m_timer.stop();
disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
m_running = false; m_running = false;
} }