From f541b53454e4072083df2d0f980f5085230aab1e Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 8 Feb 2021 22:29:27 +0100 Subject: [PATCH] Set channel message queue to null in channel before destroying its GUI. Fixes #769 --- sdrgui/device/deviceuiset.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdrgui/device/deviceuiset.cpp b/sdrgui/device/deviceuiset.cpp index 9b306de18..4d8854d10 100644 --- a/sdrgui/device/deviceuiset.cpp +++ b/sdrgui/device/deviceuiset.cpp @@ -165,7 +165,8 @@ void DeviceUISet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginA { qDebug("DeviceUISet::loadRxChannelSettings: destroying old channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelAPI->getURI())); - m_channelInstanceRegistrations[i].m_gui->destroy(); // FIXME: stop channel before + m_channelInstanceRegistrations[i].m_channelAPI->setMessageQueueToGUI(nullptr); // have channel stop sending messages to its GUI + m_channelInstanceRegistrations[i].m_gui->destroy(); m_channelInstanceRegistrations[i].m_channelAPI->destroy(); } @@ -250,6 +251,7 @@ void DeviceUISet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginA { qDebug("DeviceUISet::loadTxChannelSettings: destroying old channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelAPI->getURI())); + m_channelInstanceRegistrations[i].m_channelAPI->setMessageQueueToGUI(nullptr); // have channel stop sending messages to its GUI m_channelInstanceRegistrations[i].m_gui->destroy(); m_channelInstanceRegistrations[i].m_channelAPI->destroy(); }