From f03499a9a3e9e6f3ebd2f3951543d6c9354bab25 Mon Sep 17 00:00:00 2001 From: srcejon Date: Tue, 12 Nov 2024 12:39:14 +0000 Subject: [PATCH] ADS-B: Fix memory use after delete. For #1734 and part of #2315 --- plugins/channelrx/demodadsb/adsbdemod.cpp | 2 +- plugins/channelrx/demodadsb/adsbdemodgui.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/demodadsb/adsbdemod.cpp b/plugins/channelrx/demodadsb/adsbdemod.cpp index 96089730f..88d1ca1d1 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.cpp +++ b/plugins/channelrx/demodadsb/adsbdemod.cpp @@ -105,8 +105,8 @@ ADSBDemod::~ADSBDemod() delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); + delete m_basebandSink; // This results in a call to ADSBDemod::stop(), so need to delete before worker and thread delete m_worker; - delete m_basebandSink; delete m_thread; } diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.cpp b/plugins/channelrx/demodadsb/adsbdemodgui.cpp index aab087585..9f54f4116 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodgui.cpp @@ -5113,6 +5113,7 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb ADSBDemodGUI::~ADSBDemodGUI() { + m_adsbDemod->setMessageQueueToGUI(nullptr); disconnect(&MainCore::instance()->getSettings(), &MainSettings::preferenceChanged, this, &ADSBDemodGUI::preferenceChanged); if (m_templateServer) {