1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-03-24 13:18:29 -04:00

LocalSink: safety measures to ensure processSamples does not work when thread is stopping

This commit is contained in:
f4exb 2019-08-24 05:09:56 +02:00
parent ae07fba863
commit 78d62789f2
2 changed files with 6 additions and 1 deletions

View File

@ -111,6 +111,11 @@ void LocalSink::stop()
{
qDebug("LocalSink::stop");
disconnect(this,
SIGNAL(samplesAvailable(const quint8*, uint)),
m_sinkThread,
SLOT(processSamples(const quint8*, uint)));
if (m_sinkThread != 0)
{
m_sinkThread->startStop(false);

View File

@ -74,7 +74,7 @@ void LocalSinkThread::run()
void LocalSinkThread::processSamples(const quint8* data, uint count)
{
if (m_sampleFifo) {
if (m_sampleFifo && m_running) {
m_sampleFifo->write(data, count);
}
}