ADS-B: Fix memory use after delete. For #1734 and part of #2315

pull/2326/head
srcejon 2024-11-12 12:39:14 +00:00
rodzic cb4651af0b
commit f03499a9a3
2 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -105,8 +105,8 @@ ADSBDemod::~ADSBDemod()
delete m_networkManager; delete m_networkManager;
m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSinkAPI(this);
m_deviceAPI->removeChannelSink(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_worker;
delete m_basebandSink;
delete m_thread; delete m_thread;
} }

Wyświetl plik

@ -5113,6 +5113,7 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
ADSBDemodGUI::~ADSBDemodGUI() ADSBDemodGUI::~ADSBDemodGUI()
{ {
m_adsbDemod->setMessageQueueToGUI(nullptr);
disconnect(&MainCore::instance()->getSettings(), &MainSettings::preferenceChanged, this, &ADSBDemodGUI::preferenceChanged); disconnect(&MainCore::instance()->getSettings(), &MainSettings::preferenceChanged, this, &ADSBDemodGUI::preferenceChanged);
if (m_templateServer) if (m_templateServer)
{ {