From 13afa2e45fd70df8ae0d615ffc6f037e8654d30e Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 4 Dec 2018 01:03:21 +0100 Subject: [PATCH] SoapySDR: fixed memory leaks --- app/main.cpp | 2 +- appbench/main.cpp | 2 +- appsrv/main.cpp | 2 +- debian/changelog | 6 ++++++ plugins/samplesink/soapysdroutput/soapysdroutput.cpp | 6 ++++++ .../samplesink/soapysdroutput/soapysdroutputplugin.cpp | 2 +- plugins/samplesource/soapysdrinput/soapysdrinput.cpp | 10 +++++++++- .../samplesource/soapysdrinput/soapysdrinputplugin.cpp | 2 +- 8 files changed, 26 insertions(+), 6 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index 101f06656..511586000 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -35,7 +35,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo */ QCoreApplication::setOrganizationName("f4exb"); QCoreApplication::setApplicationName("SDRangel"); - QCoreApplication::setApplicationVersion("4.3.1"); + QCoreApplication::setApplicationVersion("4.3.2"); #if QT_VERSION >= 0x050600 QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps diff --git a/appbench/main.cpp b/appbench/main.cpp index 49161a862..4523e8be1 100644 --- a/appbench/main.cpp +++ b/appbench/main.cpp @@ -57,7 +57,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo QCoreApplication::setOrganizationName("f4exb"); QCoreApplication::setApplicationName("SDRangelBench"); - QCoreApplication::setApplicationVersion("4.3.1"); + QCoreApplication::setApplicationVersion("4.3.2"); int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP}; std::vector vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int)); diff --git a/appsrv/main.cpp b/appsrv/main.cpp index af308e7a3..b6e093761 100644 --- a/appsrv/main.cpp +++ b/appsrv/main.cpp @@ -56,7 +56,7 @@ static int runQtApplication(int argc, char* argv[], qtwebapp::LoggerWithFile *lo QCoreApplication::setOrganizationName("f4exb"); QCoreApplication::setApplicationName("SDRangelSrv"); - QCoreApplication::setApplicationVersion("4.3.1"); + QCoreApplication::setApplicationVersion("4.3.2"); int catchSignals[] = {SIGQUIT, SIGINT, SIGTERM, SIGHUP}; std::vector vsig(catchSignals, catchSignals + sizeof(catchSignals) / sizeof(int)); diff --git a/debian/changelog b/debian/changelog index 7bee4db1d..164a177fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sdrangel (4.3.2-1) unstable; urgency=medium + + * SoapySDR support: fixed memory leaks + + -- Edouard Griffiths, F4EXB Sun, 09 Dec 2018 21:14:18 +0100 + sdrangel (4.3.1-1) unstable; urgency=medium * RTL-SDR: offset tuning support diff --git a/plugins/samplesink/soapysdroutput/soapysdroutput.cpp b/plugins/samplesink/soapysdroutput/soapysdroutput.cpp index d6effe288..1f7d331a9 100644 --- a/plugins/samplesink/soapysdroutput/soapysdroutput.cpp +++ b/plugins/samplesink/soapysdroutput/soapysdroutput.cpp @@ -482,6 +482,9 @@ bool SoapySDROutput::start() ((DeviceSoapySDRShared*) (*it)->getBuddySharedPtr())->m_sink->setThread(0); } + delete[] log2Interps; + delete[] fifos; + needsStart = true; } else @@ -609,6 +612,9 @@ void SoapySDROutput::stop() qDebug("SoapySDROutput::stop: restarting the thread"); soapySDROutputThread->startWork(); } + + delete[] log2Interps; + delete[] fifos; } else // remove channel from existing thread { diff --git a/plugins/samplesink/soapysdroutput/soapysdroutputplugin.cpp b/plugins/samplesink/soapysdroutput/soapysdroutputplugin.cpp index 87a641ed3..3cdd98365 100644 --- a/plugins/samplesink/soapysdroutput/soapysdroutputplugin.cpp +++ b/plugins/samplesink/soapysdroutput/soapysdroutputplugin.cpp @@ -31,7 +31,7 @@ const PluginDescriptor SoapySDROutputPlugin::m_pluginDescriptor = { QString("SoapySDR Output"), - QString("4.3.1"), + QString("4.3.2"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/samplesource/soapysdrinput/soapysdrinput.cpp b/plugins/samplesource/soapysdrinput/soapysdrinput.cpp index b516f9eb6..a42432600 100644 --- a/plugins/samplesource/soapysdrinput/soapysdrinput.cpp +++ b/plugins/samplesource/soapysdrinput/soapysdrinput.cpp @@ -518,6 +518,10 @@ bool SoapySDRInput::start() ((DeviceSoapySDRShared*) (*it)->getBuddySharedPtr())->m_source->setThread(0); } + delete[] fcPoss; + delete[] log2Decims; + delete[] fifos; + needsStart = true; } else @@ -653,6 +657,10 @@ void SoapySDRInput::stop() qDebug("SoapySDRInput::stop: restarting the thread"); soapySDRInputThread->startWork(); } + + delete[] fcPoss; + delete[] log2Decims; + delete[] fifos; } else // remove channel from existing thread { @@ -1257,7 +1265,7 @@ bool SoapySDRInput::applySettings(const SoapySDRInputSettings& settings, bool fo if (getMessageQueueToGUI()) { - MsgReportGainChange *report = MsgReportGainChange::create(m_settings, individualGainsChanged, globalGainChanged); + MsgReportGainChange *report = MsgReportGainChange::create(m_settings, globalGainChanged, individualGainsChanged); getMessageQueueToGUI()->push(report); } } diff --git a/plugins/samplesource/soapysdrinput/soapysdrinputplugin.cpp b/plugins/samplesource/soapysdrinput/soapysdrinputplugin.cpp index d103760d2..d4f336117 100644 --- a/plugins/samplesource/soapysdrinput/soapysdrinputplugin.cpp +++ b/plugins/samplesource/soapysdrinput/soapysdrinputplugin.cpp @@ -30,7 +30,7 @@ const PluginDescriptor SoapySDRInputPlugin::m_pluginDescriptor = { QString("SoapySDR Input"), - QString("4.3.1"), + QString("4.3.2"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true,