From 1156a1931f6d3992859ca9206dfa826c67840d6f Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 24 Mar 2018 22:37:36 +0100 Subject: [PATCH] ThreadedBasebandSampleSink: destructor: call stop only if thread is running --- sdrbase/dsp/threadedbasebandsamplesink.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sdrbase/dsp/threadedbasebandsamplesink.cpp b/sdrbase/dsp/threadedbasebandsamplesink.cpp index 536b3e6cd..e646cd7cc 100644 --- a/sdrbase/dsp/threadedbasebandsamplesink.cpp +++ b/sdrbase/dsp/threadedbasebandsamplesink.cpp @@ -88,8 +88,11 @@ ThreadedBasebandSampleSink::ThreadedBasebandSampleSink(BasebandSampleSink* sampl ThreadedBasebandSampleSink::~ThreadedBasebandSampleSink() { - stop(); - delete m_threadedBasebandSampleSinkFifo; // Valgrind memcheck + if (m_thread->isRunning()) { + stop(); + } + + delete m_threadedBasebandSampleSinkFifo; // Valgrind memcheck delete m_thread; }