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:
parent
ef1a7ef8d2
commit
edb9defdf6
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user