diff --git a/plugins/channelrx/chanalyzer/chanalyzersink.cpp b/plugins/channelrx/chanalyzer/chanalyzersink.cpp index 4ef49fddf..017be9273 100644 --- a/plugins/channelrx/chanalyzer/chanalyzersink.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzersink.cpp @@ -41,6 +41,7 @@ ChannelAnalyzerSink::RRCHelper::RRCHelper(int flen) : ChannelAnalyzerSink::RRCHelper::~RRCHelper() { delete m_filterFIR; + delete m_filterFFT; delete[] m_buffer; } diff --git a/plugins/channelrx/demoddatv/leansdr/dvbs2.h b/plugins/channelrx/demoddatv/leansdr/dvbs2.h index 03061a5c7..d1220c643 100644 --- a/plugins/channelrx/demoddatv/leansdr/dvbs2.h +++ b/plugins/channelrx/demoddatv/leansdr/dvbs2.h @@ -2979,6 +2979,16 @@ struct s2_fecdec : runnable } } + ~s2_fecdec() + { + if (bitcount) { + delete bitcount; + } + if (errcount) { + delete errcount; + } + } + void run() { while (in.readable() >= 1 && out.writable() >= 1 && @@ -3292,6 +3302,12 @@ struct s2_fecdec_helper : runnable { free(command); killall(); // also deletes pools[mc][sf].procs if necessary + if (bitcount) { + delete bitcount; + } + if (errcount) { + delete errcount; + } } void run() @@ -4064,6 +4080,16 @@ struct s2_deframer : runnable { } + ~s2_deframer() + { + if (state_out) { + delete state_out; + } + if (locktime_out) { + delete locktime_out; + } + } + void run() { while (in.readable() >= 1 && out.writable() >= MAX_TS_PER_BBFRAME && diff --git a/plugins/channelrx/freqscanner/freqscanner.cpp b/plugins/channelrx/freqscanner/freqscanner.cpp index 54affd72e..9c4f903b5 100644 --- a/plugins/channelrx/freqscanner/freqscanner.cpp +++ b/plugins/channelrx/freqscanner/freqscanner.cpp @@ -1301,11 +1301,7 @@ void FreqScanner::webapiFormatChannelSettings( } if (channelSettingsKeys.contains("frequencies") || force) { QList *frequencies = createFrequencyList(settings); - if (swgFreqScannerSettings->getFrequencies()) { - *swgFreqScannerSettings->getFrequencies() = *frequencies; - } else { - swgFreqScannerSettings->setFrequencies(frequencies); - } + swgFreqScannerSettings->setFrequencies(frequencies); } if (channelSettingsKeys.contains("rgbColor") || force) { diff --git a/plugins/channelrx/radioastronomy/radioastronomyworker.cpp b/plugins/channelrx/radioastronomy/radioastronomyworker.cpp index 17066831b..6c7346571 100644 --- a/plugins/channelrx/radioastronomy/radioastronomyworker.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomyworker.cpp @@ -42,6 +42,16 @@ RadioAstronomyWorker::RadioAstronomyWorker(RadioAstronomy* radioAstronomy) : RadioAstronomyWorker::~RadioAstronomyWorker() { m_inputMessageQueue.clear(); + + for (int i = 0; i < RADIOASTRONOMY_SENSORS; i++) + { + if (m_session[i] != VI_NULL) + { + m_visa.close(m_session[i]); + m_session[i] = VI_NULL; + } + } + m_visa.closeDefault(); } diff --git a/plugins/channeltx/udpsource/udpsourceudphandler.cpp b/plugins/channeltx/udpsource/udpsourceudphandler.cpp index 9a4605093..8f4aecf0a 100644 --- a/plugins/channeltx/udpsource/udpsourceudphandler.cpp +++ b/plugins/channeltx/udpsource/udpsourceudphandler.cpp @@ -223,9 +223,11 @@ void UDPSourceUDPHandler::advanceReadPointer(int nbBytes) float dd = d - m_d; // derivative float c = (d / 15.0) + (dd / 20.0); // damping and scaling c = c < -0.05 ? -0.05 : c > 0.05 ? 0.05 : c; // limit - UDPSourceMessages::MsgSampleRateCorrection *msg = UDPSourceMessages::MsgSampleRateCorrection::create(c, d); if (m_autoRWBalance && m_feedbackMessageQueue) { + // create and immediately transfer ownership to queue + UDPSourceMessages::MsgSampleRateCorrection *msg = + UDPSourceMessages::MsgSampleRateCorrection::create(c, d); m_feedbackMessageQueue->push(msg); } diff --git a/plugins/feature/map/mapitem.h b/plugins/feature/map/mapitem.h index e3220fee8..6084384f7 100644 --- a/plugins/feature/map/mapitem.h +++ b/plugins/feature/map/mapitem.h @@ -78,6 +78,12 @@ public: { update(mapItem); } + + ~ObjectMapItem() + { + delete m_aircraftState; + } + void update(SWGSDRangel::SWGMapItem *mapItem) override; protected: diff --git a/plugins/feature/vorlocalizer/vorlocalizerworker.cpp b/plugins/feature/vorlocalizer/vorlocalizerworker.cpp index e12cf071b..49d2219fc 100644 --- a/plugins/feature/vorlocalizer/vorlocalizerworker.cpp +++ b/plugins/feature/vorlocalizer/vorlocalizerworker.cpp @@ -752,5 +752,7 @@ void VorLocalizerWorker::rrNextTurn() if (m_msgQueueToFeature) { m_msgQueueToFeature->push(msg); + } else { + delete msg; } } diff --git a/sdrbase/util/visa.cpp b/sdrbase/util/visa.cpp index 4db92081b..49b09491f 100644 --- a/sdrbase/util/visa.cpp +++ b/sdrbase/util/visa.cpp @@ -33,6 +33,9 @@ VISA::VISA() : viClose(nullptr), viPrintf(nullptr), viScanf(nullptr), + viFindRsrc(nullptr), + viFindNext(nullptr), + visaLibrary(nullptr), m_available(false) { #ifdef _MSC_VER @@ -62,6 +65,14 @@ VISA::VISA() : } } +VISA::~VISA() +{ + if (visaLibrary && (m_defaultRM == 0)) { + libraryClose(visaLibrary); + visaLibrary = nullptr; + } +} + ViSession VISA::openDefault() { if (isAvailable() && (m_defaultRM == 0)) @@ -267,6 +278,11 @@ void *VISA::libraryFunc(void *library, const char *function) return GetProcAddress ((HMODULE)library, function); } +void VISA::libraryClose(void *library) +{ + FreeLibrary((HMODULE)library); +} + #else void *VISA::libraryOpen(const char *filename) @@ -279,4 +295,9 @@ void *VISA::libraryFunc(void *library, const char *function) return dlsym (library, function); } +void VISA::libraryClose(void *library) +{ + dlclose(library); +} + #endif diff --git a/sdrbase/util/visa.h b/sdrbase/util/visa.h index 5beeb2ae6..6ad64dab1 100644 --- a/sdrbase/util/visa.h +++ b/sdrbase/util/visa.h @@ -74,6 +74,7 @@ public: ViStatus (*viFindNext) (ViSession vi, ViChar desc[]); VISA(); + ~VISA(); ViSession openDefault(); void closeDefault(); @@ -100,6 +101,7 @@ protected: void *libraryOpen(const char *filename); void *libraryFunc(void *library, const char *function); + void libraryClose(void *library); }; #endif // INCLUDE_VISA_H