Delete channel or feature and their GUI in the proper order in DeviceUISet and FeatureUISet. Remove original fix for #806. Fixes #860

pull/866/head
f4exb 2021-04-21 12:28:56 +02:00
rodzic 05bb5a148d
commit de23efe635
7 zmienionych plików z 9 dodań i 22 usunięć

Wyświetl plik

@ -525,7 +525,6 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device
ChannelAnalyzerGUI::~ChannelAnalyzerGUI()
{
m_channelAnalyzer->setSampleSink(nullptr);
qDebug("ChannelAnalyzerGUI::~ChannelAnalyzerGUI");
ui->glScope->disconnectTimer();
delete ui;

Wyświetl plik

@ -275,9 +275,6 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base
ATVDemodGUI::~ATVDemodGUI()
{
m_atvDemod->setScopeSink(nullptr);
m_atvDemod->setTVScreen(nullptr);
delete m_scopeVis;
delete ui;
}

Wyświetl plik

@ -281,12 +281,6 @@ DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Ba
DATVDemodGUI::~DATVDemodGUI()
{
m_objDATVDemod->SetTVScreen(nullptr);
m_objDATVDemod->setMERLabel(nullptr);
m_objDATVDemod->setCNRLabel(nullptr);
m_objDATVDemod->setMERMeter(nullptr);
m_objDATVDemod->setCNRMeter(nullptr);
delete ui;
}

Wyświetl plik

@ -381,7 +381,6 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
DSDDemodGUI::~DSDDemodGUI()
{
m_dsdDemod->setScopeXYSink(nullptr);
delete m_scopeVisXY;
delete ui;
}

Wyświetl plik

@ -178,8 +178,6 @@ DemodAnalyzerGUI::DemodAnalyzerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUI
DemodAnalyzerGUI::~DemodAnalyzerGUI()
{
m_demodAnalyzer->setSampleSink(nullptr);
delete ui;
delete m_spectrumScopeComboVis;
delete m_scopeVis;

Wyświetl plik

@ -128,8 +128,8 @@ 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();
m_channelInstanceRegistrations[i].m_channelAPI->destroy();
m_channelInstanceRegistrations[i].m_gui->destroy();
}
m_channelInstanceRegistrations.clear();
@ -143,8 +143,8 @@ 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();
m_channelInstanceRegistrations[channelIndex].m_channelAPI->destroy();
m_channelInstanceRegistrations[channelIndex].m_gui->destroy();
m_channelInstanceRegistrations.removeAt(channelIndex);
}
@ -167,8 +167,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_channelAPI->setMessageQueueToGUI(nullptr); // have channel stop sending messages to its GUI
m_channelInstanceRegistrations[i].m_gui->destroy();
m_channelInstanceRegistrations[i].m_channelAPI->destroy();
m_channelInstanceRegistrations[i].m_gui->destroy();
}
m_channelInstanceRegistrations.clear();
@ -253,8 +253,8 @@ 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();
m_channelInstanceRegistrations[i].m_gui->destroy();
}
m_channelInstanceRegistrations.clear();
@ -338,8 +338,8 @@ 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(); // FIXME: stop channel before
m_channelInstanceRegistrations[i].m_channelAPI->destroy();
m_channelInstanceRegistrations[i].m_channelAPI->destroy(); // stop channel before (issue #860)
m_channelInstanceRegistrations[i].m_gui->destroy();
}
m_channelInstanceRegistrations.clear();

Wyświetl plik

@ -71,8 +71,8 @@ void FeatureUISet::freeFeatures()
for(int i = 0; i < m_featureInstanceRegistrations.count(); i++)
{
qDebug("FeatureUISet::freeFeatures: destroying feature [%s]", qPrintable(m_featureInstanceRegistrations[i].m_feature->getURI()));
m_featureInstanceRegistrations[i].m_gui->destroy();
m_featureInstanceRegistrations[i].m_feature->destroy();
m_featureInstanceRegistrations[i].m_gui->destroy();
}
m_featureSet->clearFeatures();
@ -85,8 +85,8 @@ void FeatureUISet::deleteFeature(int featureIndex)
qDebug("FeatureUISet::deleteFeature: delete feature [%s] at %d",
qPrintable(m_featureInstanceRegistrations[featureIndex].m_feature->getURI()),
featureIndex);
m_featureInstanceRegistrations[featureIndex].m_gui->destroy();
m_featureInstanceRegistrations[featureIndex].m_feature->destroy();
m_featureInstanceRegistrations[featureIndex].m_gui->destroy();
m_featureSet->removeFeatureInstanceAt(featureIndex);
}
}
@ -124,8 +124,8 @@ void FeatureUISet::loadFeatureSetSettings(const FeatureSetPreset *preset, Plugin
for (int i = 0; i < openFeatures.count(); i++)
{
qDebug("FeatureUISet::loadFeatureSetSettings: destroying old feature [%s]", qPrintable(openFeatures[i].m_feature->getURI()));
openFeatures[i].m_gui->destroy();
openFeatures[i].m_feature->destroy();
openFeatures[i].m_gui->destroy();
}
qDebug("FeatureUISet::loadFeatureSetSettings: %d feature(s) in preset", preset->getFeatureCount());