1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-25 09:18:54 -05: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)
{
connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection);
connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
m_timer.start(50);
}
TestSourceWorker::~TestSourceWorker()
{
m_timer.stop();
disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
}
void TestSourceWorker::startWork()
{
qDebug("TestSourceWorker::startWork");
m_timer.setTimerType(Qt::PreciseTimer);
connect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
m_timer.start(50);
m_running = true;
}
void TestSourceWorker::stopWork()
{
qDebug("TestSourceWorker::stopWork");
m_timer.stop();
disconnect(&m_timer, SIGNAL(timeout()), this, SLOT(tick()));
m_running = false;
}