Skip to content

Commit

Permalink
Removed the destroy method from ChannelGUI interface
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Aug 27, 2024
1 parent b85419c commit 704eb40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions sdrgui/channel/channelgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ class SDRGUI_API ChannelGUI : public QMdiSubWindow, public SerializableInterface
ContextMenuChannelSettings
};

ChannelGUI(QWidget *parent = nullptr);
virtual ~ChannelGUI();
virtual void destroy() = 0;
explicit ChannelGUI(QWidget *parent = nullptr);
~ChannelGUI() override;

virtual void resetToDefaults() = 0;
// Data saved in the derived settings
Expand Down
10 changes: 5 additions & 5 deletions sdrgui/device/deviceuiset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void DeviceUISet::freeChannels()
for(int i = 0; i < m_channelInstanceRegistrations.count(); i++)
{
qDebug("DeviceUISet::freeChannels: destroying channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelAPI->getURI()));
m_channelInstanceRegistrations[i].m_gui->destroy();
delete m_channelInstanceRegistrations[i].m_gui;
delete m_channelInstanceRegistrations[i].m_channelAPI;
}

Expand All @@ -181,7 +181,7 @@ void DeviceUISet::deleteChannel(int channelIndex)
qDebug("DeviceUISet::deleteChannel: delete channel [%s] at %d",
qPrintable(m_channelInstanceRegistrations[channelIndex].m_channelAPI->getURI()),
channelIndex);
m_channelInstanceRegistrations[channelIndex].m_gui->destroy();
delete m_channelInstanceRegistrations[channelIndex].m_gui;
delete m_channelInstanceRegistrations[channelIndex].m_channelAPI;
m_channelInstanceRegistrations.removeAt(channelIndex);
}
Expand Down Expand Up @@ -320,7 +320,7 @@ 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_channelAPI->setMessageQueueToGUI(nullptr); // have channel stop sending messages to its GUI
m_channelInstanceRegistrations[i].m_gui->destroy();
delete m_channelInstanceRegistrations[i].m_gui;
delete m_channelInstanceRegistrations[i].m_channelAPI;
}

Expand Down Expand Up @@ -449,7 +449,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();
delete m_channelInstanceRegistrations[i].m_gui;
delete m_channelInstanceRegistrations[i].m_channelAPI;
}

Expand Down Expand Up @@ -575,7 +575,7 @@ void DeviceUISet::loadMIMOChannelSettings(const Preset *preset, PluginAPI *plugi
{
qDebug("DeviceUISet::loadMIMOChannelSettings: destroying old channel [%s]",
qPrintable(m_channelInstanceRegistrations[i].m_channelAPI->getURI()));
m_channelInstanceRegistrations[i].m_gui->destroy(); // stop GUI first (issue #1427)
delete m_channelInstanceRegistrations[i].m_gui; // stop GUI first (issue #1427)
delete m_channelInstanceRegistrations[i].m_channelAPI; // stop channel before (issue #860)
}

Expand Down

0 comments on commit 704eb40

Please sign in to comment.