diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.cpp b/plugins/channelrx/chanalyzer/chanalyzergui.cpp index 5b7215ed4..14f1b8208 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzergui.cpp @@ -424,7 +424,6 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device ChannelAnalyzerGUI::~ChannelAnalyzerGUI() { - delete m_channelAnalyzer; // TODO: check this: when the GUI closes it has to delete the demodulator delete m_scopeVis; delete m_spectrumScopeComboVis; delete ui; diff --git a/plugins/channelrx/demodam/amdemod.cpp b/plugins/channelrx/demodam/amdemod.cpp index e499fe821..3599d0843 100644 --- a/plugins/channelrx/demodam/amdemod.cpp +++ b/plugins/channelrx/demodam/amdemod.cpp @@ -64,6 +64,7 @@ AMDemod::AMDemod(DeviceAPI *deviceAPI) : AMDemod::~AMDemod() { + qDebug("AMDemod::~AMDemod"); disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); diff --git a/plugins/channelrx/demodam/amdemod.h b/plugins/channelrx/demodam/amdemod.h index f3835b633..00ccf7e1c 100644 --- a/plugins/channelrx/demodam/amdemod.h +++ b/plugins/channelrx/demodam/amdemod.h @@ -62,7 +62,7 @@ public: }; AMDemod(DeviceAPI *deviceAPI); - ~AMDemod(); + virtual ~AMDemod(); virtual void destroy() { delete this; } virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po); diff --git a/plugins/channelrx/demodam/amdemodgui.cpp b/plugins/channelrx/demodam/amdemodgui.cpp index 23ae42683..bcefce9ac 100644 --- a/plugins/channelrx/demodam/amdemodgui.cpp +++ b/plugins/channelrx/demodam/amdemodgui.cpp @@ -289,7 +289,6 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS AMDemodGUI::~AMDemodGUI() { - delete m_amDemod; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channelrx/demodatv/atvdemod.h b/plugins/channelrx/demodatv/atvdemod.h index aee2727a1..560bc26be 100644 --- a/plugins/channelrx/demodatv/atvdemod.h +++ b/plugins/channelrx/demodatv/atvdemod.h @@ -61,7 +61,7 @@ public: }; ATVDemod(DeviceAPI *deviceAPI); - ~ATVDemod(); + virtual ~ATVDemod(); virtual void destroy() { delete this; } virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po); diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index 37e281a41..c310670ec 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -275,7 +275,6 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base ATVDemodGUI::~ATVDemodGUI() { - delete m_atvDemod; // TODO: check this: when the GUI closes it has to delete the demodulator delete m_scopeVis; delete ui; } diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.cpp b/plugins/channelrx/demodbfm/bfmdemodgui.cpp index 8ce703b39..039d313f4 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.cpp +++ b/plugins/channelrx/demodbfm/bfmdemodgui.cpp @@ -420,7 +420,6 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban BFMDemodGUI::~BFMDemodGUI() { - delete m_bfmDemod; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channelrx/demoddatv/datvdemod.h b/plugins/channelrx/demoddatv/datvdemod.h index 4a198866d..4bf76f4cd 100644 --- a/plugins/channelrx/demoddatv/datvdemod.h +++ b/plugins/channelrx/demoddatv/datvdemod.h @@ -38,7 +38,7 @@ class DATVDemod : public BasebandSampleSink, public ChannelAPI public: DATVDemod(DeviceAPI *); - ~DATVDemod(); + virtual ~DATVDemod(); virtual void destroy() { delete this; } virtual void getIdentifier(QString& id) { id = m_channelId; } diff --git a/plugins/channelrx/demoddatv/datvdemodgui.cpp b/plugins/channelrx/demoddatv/datvdemodgui.cpp index 9d5e65a45..7e0ca3c11 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.cpp +++ b/plugins/channelrx/demoddatv/datvdemodgui.cpp @@ -244,7 +244,6 @@ DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Ba DATVDemodGUI::~DATVDemodGUI() { - delete m_objDATVDemod; delete ui; } diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index aa12a87c2..0d554bfcd 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -63,7 +63,7 @@ public: }; DSDDemod(DeviceAPI *deviceAPI); - ~DSDDemod(); + virtual ~DSDDemod(); virtual void destroy() { delete this; } virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po); diff --git a/plugins/channelrx/demoddsd/dsddemodgui.cpp b/plugins/channelrx/demoddsd/dsddemodgui.cpp index f9f453c13..70490c71c 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.cpp +++ b/plugins/channelrx/demoddsd/dsddemodgui.cpp @@ -381,7 +381,6 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban DSDDemodGUI::~DSDDemodGUI() { - delete m_dsdDemod; // TODO: check this: when the GUI closes it has to delete the demodulator delete m_scopeVisXY; delete ui; } diff --git a/plugins/channelrx/demodfreedv/freedvdemodgui.cpp b/plugins/channelrx/demodfreedv/freedvdemodgui.cpp index fe4056113..2c74f52f4 100644 --- a/plugins/channelrx/demodfreedv/freedvdemodgui.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemodgui.cpp @@ -308,7 +308,6 @@ FreeDVDemodGUI::FreeDVDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B FreeDVDemodGUI::~FreeDVDemodGUI() { - delete m_freeDVDemod; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channelrx/demodlora/lorademodgui.cpp b/plugins/channelrx/demodlora/lorademodgui.cpp index 94824fb8c..51f237b3b 100644 --- a/plugins/channelrx/demodlora/lorademodgui.cpp +++ b/plugins/channelrx/demodlora/lorademodgui.cpp @@ -147,8 +147,6 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb LoRaDemodGUI::~LoRaDemodGUI() { - m_deviceUISet->removeRxChannelInstance(this); - delete m_LoRaDemod; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index 73334ce29..b17250c6f 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -62,7 +62,7 @@ public: }; NFMDemod(DeviceAPI *deviceAPI); - ~NFMDemod(); + virtual ~NFMDemod(); virtual void destroy() { delete this; } virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positive); diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.cpp b/plugins/channelrx/demodnfm/nfmdemodgui.cpp index a8a092488..08963b9fc 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodgui.cpp @@ -333,7 +333,6 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban NFMDemodGUI::~NFMDemodGUI() { - delete m_nfmDemod; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index b57ce63b8..de80982aa 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -342,7 +342,6 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban SSBDemodGUI::~SSBDemodGUI() { - delete m_ssbDemod; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.cpp b/plugins/channelrx/demodwfm/wfmdemodgui.cpp index 7bf845536..16ec4b152 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.cpp +++ b/plugins/channelrx/demodwfm/wfmdemodgui.cpp @@ -246,8 +246,6 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban WFMDemodGUI::~WFMDemodGUI() { - delete m_wfmDemod; // TODO: check this: when the GUI closes it has to delete the demodulator - //delete m_channelMarker; delete ui; } diff --git a/plugins/channelrx/filesink/filesinkgui.cpp b/plugins/channelrx/filesink/filesinkgui.cpp index 84941196f..13d197859 100644 --- a/plugins/channelrx/filesink/filesinkgui.cpp +++ b/plugins/channelrx/filesink/filesinkgui.cpp @@ -198,7 +198,6 @@ FileSinkGUI::FileSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban FileSinkGUI::~FileSinkGUI() { - delete m_fileSink; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channelrx/freqtracker/freqtracker.h b/plugins/channelrx/freqtracker/freqtracker.h index 1cbd657aa..224059e3b 100644 --- a/plugins/channelrx/freqtracker/freqtracker.h +++ b/plugins/channelrx/freqtracker/freqtracker.h @@ -60,7 +60,7 @@ public: }; FreqTracker(DeviceAPI *deviceAPI); - ~FreqTracker(); + virtual ~FreqTracker(); virtual void destroy() { delete this; } virtual void feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool po); diff --git a/plugins/channelrx/freqtracker/freqtrackergui.cpp b/plugins/channelrx/freqtracker/freqtrackergui.cpp index 90a2a6782..7d6f45e53 100644 --- a/plugins/channelrx/freqtracker/freqtrackergui.cpp +++ b/plugins/channelrx/freqtracker/freqtrackergui.cpp @@ -332,7 +332,6 @@ FreqTrackerGUI::FreqTrackerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B FreqTrackerGUI::~FreqTrackerGUI() { - delete m_freqTracker; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channelrx/localsink/localsinkgui.cpp b/plugins/channelrx/localsink/localsinkgui.cpp index 5820e3fba..0d8667e65 100644 --- a/plugins/channelrx/localsink/localsinkgui.cpp +++ b/plugins/channelrx/localsink/localsinkgui.cpp @@ -130,7 +130,6 @@ LocalSinkGUI::LocalSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb LocalSinkGUI::~LocalSinkGUI() { - delete m_localSink; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channelrx/remotesink/remotesinkgui.cpp b/plugins/channelrx/remotesink/remotesinkgui.cpp index 7665a379a..137dc9673 100644 --- a/plugins/channelrx/remotesink/remotesinkgui.cpp +++ b/plugins/channelrx/remotesink/remotesinkgui.cpp @@ -129,7 +129,6 @@ RemoteSinkGUI::RemoteSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas RemoteSinkGUI::~RemoteSinkGUI() { - delete m_remoteSink; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channelrx/udpsink/udpsinkgui.cpp b/plugins/channelrx/udpsink/udpsinkgui.cpp index 237361dd4..638177259 100644 --- a/plugins/channelrx/udpsink/udpsinkgui.cpp +++ b/plugins/channelrx/udpsink/udpsinkgui.cpp @@ -209,7 +209,6 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS UDPSinkGUI::~UDPSinkGUI() { - delete m_udpSink; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channeltx/filesource/filesource.h b/plugins/channeltx/filesource/filesource.h index 950c9c303..a1ae86a8e 100644 --- a/plugins/channeltx/filesource/filesource.h +++ b/plugins/channeltx/filesource/filesource.h @@ -166,7 +166,7 @@ public: }; FileSource(DeviceAPI *deviceAPI); - ~FileSource(); + virtual ~FileSource(); virtual void destroy() { delete this; } virtual void start(); diff --git a/plugins/channeltx/filesource/filesourcegui.cpp b/plugins/channeltx/filesource/filesourcegui.cpp index 198881572..6309325b7 100644 --- a/plugins/channeltx/filesource/filesourcegui.cpp +++ b/plugins/channeltx/filesource/filesourcegui.cpp @@ -216,7 +216,6 @@ FileSourceGUI::FileSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas FileSourceGUI::~FileSourceGUI() { - delete m_fileSource; delete ui; } diff --git a/plugins/channeltx/localsource/localsourcegui.cpp b/plugins/channeltx/localsource/localsourcegui.cpp index 5d7c60d30..dcbfb72e1 100644 --- a/plugins/channeltx/localsource/localsourcegui.cpp +++ b/plugins/channeltx/localsource/localsourcegui.cpp @@ -125,7 +125,6 @@ LocalSourceGUI::LocalSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B LocalSourceGUI::~LocalSourceGUI() { - delete m_localSource; // TODO: check this: when the GUI closes it has to delete the demodulator delete ui; } diff --git a/plugins/channeltx/modam/ammod.h b/plugins/channeltx/modam/ammod.h index 9044cad14..edf4558a5 100644 --- a/plugins/channeltx/modam/ammod.h +++ b/plugins/channeltx/modam/ammod.h @@ -173,7 +173,7 @@ public: //================================================================= AMMod(DeviceAPI *deviceAPI); - ~AMMod(); + virtual ~AMMod(); virtual void destroy() { delete this; } virtual void start(); diff --git a/plugins/channeltx/modam/ammodgui.cpp b/plugins/channeltx/modam/ammodgui.cpp index 0fafc6090..a6ce632ae 100644 --- a/plugins/channeltx/modam/ammodgui.cpp +++ b/plugins/channeltx/modam/ammodgui.cpp @@ -385,7 +385,6 @@ AMModGUI::AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampl AMModGUI::~AMModGUI() { - delete m_amMod; // TODO: check this: when the GUI closes it has to delete the modulator delete ui; } diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h index bb2e2a91a..5556dde4a 100644 --- a/plugins/channeltx/modatv/atvmod.h +++ b/plugins/channeltx/modatv/atvmod.h @@ -245,7 +245,7 @@ public: //================================================================= ATVMod(DeviceAPI *deviceAPI); - ~ATVMod(); + virtual ~ATVMod(); virtual void destroy() { delete this; } virtual void start(); diff --git a/plugins/channeltx/modatv/atvmodgui.cpp b/plugins/channeltx/modatv/atvmodgui.cpp index cf7a26f8e..255822c5e 100644 --- a/plugins/channeltx/modatv/atvmodgui.cpp +++ b/plugins/channeltx/modatv/atvmodgui.cpp @@ -116,7 +116,6 @@ ATVModGUI::ATVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam ATVModGUI::~ATVModGUI() { - delete m_atvMod; // TODO: check this: when the GUI closes it has to delete the modulator delete ui; } diff --git a/plugins/channeltx/modfreedv/freedvmod.h b/plugins/channeltx/modfreedv/freedvmod.h index 73b42719a..f1601b872 100644 --- a/plugins/channeltx/modfreedv/freedvmod.h +++ b/plugins/channeltx/modfreedv/freedvmod.h @@ -177,7 +177,7 @@ public: //================================================================= FreeDVMod(DeviceAPI *deviceAPI); - ~FreeDVMod(); + virtual ~FreeDVMod(); virtual void destroy() { delete this; } virtual void start(); diff --git a/plugins/channeltx/modfreedv/freedvmodgui.cpp b/plugins/channeltx/modfreedv/freedvmodgui.cpp index 550898121..afef3f2dd 100644 --- a/plugins/channeltx/modfreedv/freedvmodgui.cpp +++ b/plugins/channeltx/modfreedv/freedvmodgui.cpp @@ -396,7 +396,6 @@ FreeDVModGUI::FreeDVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb FreeDVModGUI::~FreeDVModGUI() { - delete m_freeDVMod; // TODO: check this: when the GUI closes it has to delete the modulator delete ui; } diff --git a/plugins/channeltx/modnfm/nfmmod.h b/plugins/channeltx/modnfm/nfmmod.h index 5d779ffe2..875af3328 100644 --- a/plugins/channeltx/modnfm/nfmmod.h +++ b/plugins/channeltx/modnfm/nfmmod.h @@ -173,7 +173,7 @@ public: //================================================================= NFMMod(DeviceAPI *deviceAPI); - ~NFMMod(); + virtual ~NFMMod(); virtual void destroy() { delete this; } virtual void start(); diff --git a/plugins/channeltx/modnfm/nfmmodgui.cpp b/plugins/channeltx/modnfm/nfmmodgui.cpp index bcff10fd0..48a1ce28c 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.cpp +++ b/plugins/channeltx/modnfm/nfmmodgui.cpp @@ -418,7 +418,6 @@ NFMModGUI::NFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam NFMModGUI::~NFMModGUI() { - delete m_nfmMod; // TODO: check this: when the GUI closes it has to delete the modulator delete ui; } diff --git a/plugins/channeltx/modpacket/packetmod.h b/plugins/channeltx/modpacket/packetmod.h index cc06f7cb3..972b080f1 100644 --- a/plugins/channeltx/modpacket/packetmod.h +++ b/plugins/channeltx/modpacket/packetmod.h @@ -94,7 +94,7 @@ public: //================================================================= PacketMod(DeviceAPI *deviceAPI); - ~PacketMod(); + virtual ~PacketMod(); virtual void destroy() { delete this; } virtual void start(); diff --git a/plugins/channeltx/modpacket/packetmodgui.cpp b/plugins/channeltx/modpacket/packetmodgui.cpp index 9f0100b2b..19b8b4076 100644 --- a/plugins/channeltx/modpacket/packetmodgui.cpp +++ b/plugins/channeltx/modpacket/packetmodgui.cpp @@ -465,7 +465,6 @@ PacketModGUI::PacketModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb PacketModGUI::~PacketModGUI() { - delete m_packetMod; // TODO: check this: when the GUI closes it has to delete the modulator delete ui; } diff --git a/plugins/channeltx/modssb/ssbmod.h b/plugins/channeltx/modssb/ssbmod.h index 4f599ca40..8f3913989 100644 --- a/plugins/channeltx/modssb/ssbmod.h +++ b/plugins/channeltx/modssb/ssbmod.h @@ -175,7 +175,7 @@ public: //================================================================= SSBMod(DeviceAPI *deviceAPI); - ~SSBMod(); + virtual ~SSBMod(); virtual void destroy() { delete this; } virtual void start(); diff --git a/plugins/channeltx/modssb/ssbmodgui.cpp b/plugins/channeltx/modssb/ssbmodgui.cpp index e7004e4b1..8419bd35d 100644 --- a/plugins/channeltx/modssb/ssbmodgui.cpp +++ b/plugins/channeltx/modssb/ssbmodgui.cpp @@ -464,7 +464,6 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam SSBModGUI::~SSBModGUI() { - delete m_ssbMod; // TODO: check this: when the GUI closes it has to delete the modulator delete ui; } diff --git a/plugins/channeltx/modwfm/wfmmod.h b/plugins/channeltx/modwfm/wfmmod.h index a7af51929..4b6e0696f 100644 --- a/plugins/channeltx/modwfm/wfmmod.h +++ b/plugins/channeltx/modwfm/wfmmod.h @@ -173,7 +173,7 @@ public: //================================================================= WFMMod(DeviceAPI *deviceAPI); - ~WFMMod(); + virtual ~WFMMod(); virtual void destroy() { delete this; } virtual void start(); diff --git a/plugins/channeltx/modwfm/wfmmodgui.cpp b/plugins/channeltx/modwfm/wfmmodgui.cpp index 92f7a88e3..f7f30225c 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.cpp +++ b/plugins/channeltx/modwfm/wfmmodgui.cpp @@ -402,7 +402,6 @@ WFMModGUI::WFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam WFMModGUI::~WFMModGUI() { - delete m_wfmMod; // TODO: check this: when the GUI closes it has to delete the modulator delete ui; } diff --git a/plugins/channeltx/remotesource/remotesource.h b/plugins/channeltx/remotesource/remotesource.h index 4dbda4cee..41b9519cc 100644 --- a/plugins/channeltx/remotesource/remotesource.h +++ b/plugins/channeltx/remotesource/remotesource.h @@ -155,7 +155,7 @@ public: }; RemoteSource(DeviceAPI *deviceAPI); - ~RemoteSource(); + virtual ~RemoteSource(); virtual void destroy() { delete this; } diff --git a/plugins/channeltx/remotesource/remotesourcegui.cpp b/plugins/channeltx/remotesource/remotesourcegui.cpp index 4f40b5780..df8e8af74 100644 --- a/plugins/channeltx/remotesource/remotesourcegui.cpp +++ b/plugins/channeltx/remotesource/remotesourcegui.cpp @@ -190,7 +190,6 @@ RemoteSourceGUI::RemoteSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, RemoteSourceGUI::~RemoteSourceGUI() { - delete m_remoteSrc; delete ui; } diff --git a/plugins/channeltx/udpsource/udpsourcegui.cpp b/plugins/channeltx/udpsource/udpsourcegui.cpp index a9684ca03..d939191e8 100644 --- a/plugins/channeltx/udpsource/udpsourcegui.cpp +++ b/plugins/channeltx/udpsource/udpsourcegui.cpp @@ -163,7 +163,6 @@ UDPSourceGUI::UDPSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb UDPSourceGUI::~UDPSourceGUI() { - delete m_udpSource; // TODO: check this: when the GUI closes it has to delete the modulator delete ui; } diff --git a/plugins/feature/rigctlserver/rigctlserver.h b/plugins/feature/rigctlserver/rigctlserver.h index 9ece7ee55..17814a46a 100644 --- a/plugins/feature/rigctlserver/rigctlserver.h +++ b/plugins/feature/rigctlserver/rigctlserver.h @@ -82,7 +82,7 @@ public: }; RigCtlServer(WebAPIAdapterInterface *webAPIAdapterInterface); - ~RigCtlServer(); + virtual ~RigCtlServer(); virtual void destroy() { delete this; } virtual bool handleMessage(const Message& cmd); diff --git a/plugins/feature/simpleptt/simpleptt.h b/plugins/feature/simpleptt/simpleptt.h index 0b3a92d03..1f2d4a540 100644 --- a/plugins/feature/simpleptt/simpleptt.h +++ b/plugins/feature/simpleptt/simpleptt.h @@ -100,7 +100,7 @@ public: }; SimplePTT(WebAPIAdapterInterface *webAPIAdapterInterface); - ~SimplePTT(); + virtual ~SimplePTT(); virtual void destroy() { delete this; } virtual bool handleMessage(const Message& cmd); diff --git a/sdrgui/device/deviceuiset.cpp b/sdrgui/device/deviceuiset.cpp index 5bec455bf..430035dc3 100644 --- a/sdrgui/device/deviceuiset.cpp +++ b/sdrgui/device/deviceuiset.cpp @@ -94,63 +94,49 @@ void DeviceUISet::addRollupWidget(QWidget *widget) m_channelWindow->addRollupWidget(widget); } -void DeviceUISet::registerRxChannelInstance(const QString& channelName, ChannelAPI *channelAPI, ChannelGUI* pluginGUI) +void DeviceUISet::registerRxChannelInstance(const QString& channelName, ChannelAPI *channelAPI, ChannelGUI* channelGUI) { - m_channelInstanceRegistrations.append(ChannelInstanceRegistration(channelName, channelAPI, pluginGUI, 0)); + m_channelInstanceRegistrations.append(ChannelInstanceRegistration(channelName, channelAPI, channelGUI, 0)); + QObject::connect( + channelGUI, + &ChannelGUI::closing, + this, + [=](){ this->handleChannelGUIClosing(channelGUI); }, + Qt::QueuedConnection + ); } -void DeviceUISet::registerTxChannelInstance(const QString& channelName, ChannelAPI *channelAPI, ChannelGUI* pluginGUI) +void DeviceUISet::registerTxChannelInstance(const QString& channelName, ChannelAPI *channelAPI, ChannelGUI* channelGUI) { - m_channelInstanceRegistrations.append(ChannelInstanceRegistration(channelName, channelAPI, pluginGUI, 1)); + m_channelInstanceRegistrations.append(ChannelInstanceRegistration(channelName, channelAPI, channelGUI, 1)); + QObject::connect( + channelGUI, + &ChannelGUI::closing, + this, + [=](){ this->handleChannelGUIClosing(channelGUI); }, + Qt::QueuedConnection + ); } -void DeviceUISet::registerChannelInstance(const QString& channelName, ChannelAPI *channelAPI, ChannelGUI* pluginGUI) +void DeviceUISet::registerChannelInstance(const QString& channelName, ChannelAPI *channelAPI, ChannelGUI* channelGUI) { - m_channelInstanceRegistrations.append(ChannelInstanceRegistration(channelName, channelAPI, pluginGUI, 2)); -} - -void DeviceUISet::removeRxChannelInstance(ChannelGUI* pluginGUI) -{ - for (ChannelInstanceRegistrations::iterator it = m_channelInstanceRegistrations.begin(); it != m_channelInstanceRegistrations.end(); ++it) - { - if (it->m_gui == pluginGUI) - { - m_channelInstanceRegistrations.erase(it); - break; - } - } -} - -void DeviceUISet::removeTxChannelInstance(ChannelGUI* pluginGUI) -{ - for (ChannelInstanceRegistrations::iterator it = m_channelInstanceRegistrations.begin(); it != m_channelInstanceRegistrations.end(); ++it) - { - if (it->m_gui == pluginGUI) - { - m_channelInstanceRegistrations.erase(it); - break; - } - } -} - -void DeviceUISet::removeChannelInstance(ChannelGUI* pluginGUI) -{ - for (ChannelInstanceRegistrations::iterator it = m_channelInstanceRegistrations.begin(); it != m_channelInstanceRegistrations.end(); ++it) - { - if (it->m_gui == pluginGUI) - { - m_channelInstanceRegistrations.erase(it); - break; - } - } + m_channelInstanceRegistrations.append(ChannelInstanceRegistration(channelName, channelAPI, channelGUI, 2)); + QObject::connect( + channelGUI, + &ChannelGUI::closing, + this, + [=](){ this->handleChannelGUIClosing(channelGUI); }, + Qt::QueuedConnection + ); } void DeviceUISet::freeChannels() { for(int i = 0; i < m_channelInstanceRegistrations.count(); i++) { - qDebug("DeviceUISet::freeChannels: destroying channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelName)); + qDebug("DeviceUISet::freeChannels: destroying channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelURI)); m_channelInstanceRegistrations[i].m_gui->destroy(); + m_channelInstanceRegistrations[i].m_channelAPI->destroy(); } } @@ -159,9 +145,10 @@ void DeviceUISet::deleteChannel(int channelIndex) if ((channelIndex >= 0) && (channelIndex < m_channelInstanceRegistrations.count())) { qDebug("DeviceUISet::deleteChannel: delete channel [%s] at %d", - qPrintable(m_channelInstanceRegistrations[channelIndex].m_channelName), + qPrintable(m_channelInstanceRegistrations[channelIndex].m_channelURI), channelIndex); m_channelInstanceRegistrations[channelIndex].m_gui->destroy(); + m_channelInstanceRegistrations[channelIndex].m_channelAPI->destroy(); } } @@ -169,21 +156,22 @@ void DeviceUISet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginA { if (preset->isSourcePreset()) { - qDebug("DeviceUISet::loadRxChannelSettings: Loading preset [%s | %s]", qPrintable(preset->getGroup()), qPrintable(preset->getDescription())); + qDebug("DeviceUISet::loadRxChannelSettings: Loading preset [%s | %s]", + qPrintable(preset->getGroup()), qPrintable(preset->getDescription())); // Available channel plugins PluginAPI::ChannelRegistrations *channelRegistrations = pluginAPI->getRxChannelRegistrations(); - // copy currently open channels and clear list - ChannelInstanceRegistrations openChannels = m_channelInstanceRegistrations; - m_channelInstanceRegistrations.clear(); - - for(int i = 0; i < openChannels.count(); i++) + // clear list + for(int i = 0; i < m_channelInstanceRegistrations.count(); i++) { - qDebug("DeviceUISet::loadRxChannelSettings: destroying old channel [%s]", qPrintable(openChannels[i].m_channelName)); - openChannels[i].m_gui->destroy(); // FIXME: stop channel before + qDebug("DeviceUISet::loadRxChannelSettings: destroying old channel [%s]", + qPrintable(m_channelInstanceRegistrations[i].m_channelURI)); + m_channelInstanceRegistrations[i].m_gui->destroy(); // FIXME: stop channel before + m_channelInstanceRegistrations[i].m_channelAPI->destroy(); } + m_channelInstanceRegistrations.clear(); qDebug("DeviceUISet::loadRxChannelSettings: %d channel(s) in preset", preset->getChannelCount()); for (int i = 0; i < preset->getChannelCount(); i++) @@ -206,6 +194,13 @@ void DeviceUISet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginA (*channelRegistrations)[i].m_plugin->createRxChannel(m_deviceAPI, &rxChannel, &channelAPI); rxChannelGUI = (*channelRegistrations)[i].m_plugin->createRxChannelGUI(this, rxChannel); registerRxChannelInstance(channelAPI->getURI(), channelAPI, rxChannelGUI); + QObject::connect( + rxChannelGUI, + &ChannelGUI::closing, + this, + [=](){ this->handleChannelGUIClosing(rxChannelGUI); }, + Qt::QueuedConnection + ); break; } } @@ -231,8 +226,8 @@ void DeviceUISet::saveRxChannelSettings(Preset *preset) for(int i = 0; i < m_channelInstanceRegistrations.count(); i++) { - qDebug("DeviceUISet::saveRxChannelSettings: saving channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelName)); - preset->addChannel(m_channelInstanceRegistrations[i].m_channelName, m_channelInstanceRegistrations[i].m_gui->serialize()); + qDebug("DeviceUISet::saveRxChannelSettings: saving channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelURI)); + preset->addChannel(m_channelInstanceRegistrations[i].m_channelURI, m_channelInstanceRegistrations[i].m_gui->serialize()); } } else @@ -245,21 +240,22 @@ void DeviceUISet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginA { if (preset->isSinkPreset()) { - qDebug("DeviceUISet::loadTxChannelSettings: Loading preset [%s | %s]", qPrintable(preset->getGroup()), qPrintable(preset->getDescription())); + qDebug("DeviceUISet::loadTxChannelSettings: Loading preset [%s | %s]", + qPrintable(preset->getGroup()), qPrintable(preset->getDescription())); // Available channel plugins PluginAPI::ChannelRegistrations *channelRegistrations = pluginAPI->getTxChannelRegistrations(); - // copy currently open channels and clear list - ChannelInstanceRegistrations openChannels = m_channelInstanceRegistrations; - m_channelInstanceRegistrations.clear(); - - for(int i = 0; i < openChannels.count(); i++) + // clear list + for(int i = 0; i < m_channelInstanceRegistrations.count(); i++) { - qDebug("DeviceUISet::loadTxChannelSettings: destroying old channel [%s]", qPrintable(openChannels[i].m_channelName)); - openChannels[i].m_gui->destroy(); + qDebug("DeviceUISet::loadTxChannelSettings: destroying old channel [%s]", + qPrintable(m_channelInstanceRegistrations[i].m_channelURI)); + m_channelInstanceRegistrations[i].m_gui->destroy(); + m_channelInstanceRegistrations[i].m_channelAPI->destroy(); } + m_channelInstanceRegistrations.clear(); qDebug("DeviceUISet::loadTxChannelSettings: %d channel(s) in preset", preset->getChannelCount()); for(int i = 0; i < preset->getChannelCount(); i++) @@ -281,6 +277,13 @@ void DeviceUISet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginA (*channelRegistrations)[i].m_plugin->createTxChannel(m_deviceAPI, &txChannel, &channelAPI); txChannelGUI = (*channelRegistrations)[i].m_plugin->createTxChannelGUI(this, txChannel); registerTxChannelInstance(channelAPI->getURI(), channelAPI, txChannelGUI); + QObject::connect( + txChannelGUI, + &ChannelGUI::closing, + this, + [=](){ this->handleChannelGUIClosing(txChannelGUI); }, + Qt::QueuedConnection + ); break; } } @@ -307,8 +310,8 @@ void DeviceUISet::saveTxChannelSettings(Preset *preset) for(int i = 0; i < m_channelInstanceRegistrations.count(); i++) { - qDebug("DeviceUISet::saveTxChannelSettings: saving channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelName)); - preset->addChannel(m_channelInstanceRegistrations[i].m_channelName, m_channelInstanceRegistrations[i].m_gui->serialize()); + qDebug("DeviceUISet::saveTxChannelSettings: saving channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelURI)); + preset->addChannel(m_channelInstanceRegistrations[i].m_channelURI, m_channelInstanceRegistrations[i].m_gui->serialize()); } } else @@ -321,21 +324,22 @@ void DeviceUISet::loadMIMOChannelSettings(const Preset *preset, PluginAPI *plugi { if (preset->isMIMOPreset()) { - qDebug("DeviceUISet::loadMIMOChannelSettings: Loading preset [%s | %s]", qPrintable(preset->getGroup()), qPrintable(preset->getDescription())); + qDebug("DeviceUISet::loadMIMOChannelSettings: Loading preset [%s | %s]", + qPrintable(preset->getGroup()), qPrintable(preset->getDescription())); // Available channel plugins PluginAPI::ChannelRegistrations *channelRegistrations = pluginAPI->getMIMOChannelRegistrations(); - // copy currently open channels and clear list - ChannelInstanceRegistrations openChannels = m_channelInstanceRegistrations; - m_channelInstanceRegistrations.clear(); - - for(int i = 0; i < openChannels.count(); i++) + // clear list + for(int i = 0; i < m_channelInstanceRegistrations.count(); i++) { - qDebug("DeviceUISet::loadMIMOChannelSettings: destroying old channel [%s]", qPrintable(openChannels[i].m_channelName)); - openChannels[i].m_gui->destroy(); // FIXME: stop channel before + qDebug("DeviceUISet::loadMIMOChannelSettings: destroying old channel [%s]", + qPrintable(m_channelInstanceRegistrations[i].m_channelURI)); + m_channelInstanceRegistrations[i].m_gui->destroy(); // FIXME: stop channel before + m_channelInstanceRegistrations[i].m_channelAPI->destroy(); } + m_channelInstanceRegistrations.clear(); qDebug("DeviceUISet::loadMIMOChannelSettings: %d channel(s) in preset", preset->getChannelCount()); for (int i = 0; i < preset->getChannelCount(); i++) @@ -359,6 +363,13 @@ void DeviceUISet::loadMIMOChannelSettings(const Preset *preset, PluginAPI *plugi mimoChannelGUI = (*channelRegistrations)[i].m_plugin->createMIMOChannelGUI(this, mimoChannel); (*channelRegistrations)[i].m_plugin->createMIMOChannel(m_deviceAPI, &mimoChannel, &channelAPI); registerChannelInstance(channelAPI->getURI(), channelAPI, mimoChannelGUI); + QObject::connect( + mimoChannelGUI, + &ChannelGUI::closing, + this, + [=](){ this->handleChannelGUIClosing(mimoChannelGUI); }, + Qt::QueuedConnection + ); break; } } @@ -384,8 +395,8 @@ void DeviceUISet::saveMIMOChannelSettings(Preset *preset) for(int i = 0; i < m_channelInstanceRegistrations.count(); i++) { - qDebug("DeviceUISet::saveMIMOChannelSettings: saving channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelName)); - preset->addChannel(m_channelInstanceRegistrations[i].m_channelName, m_channelInstanceRegistrations[i].m_gui->serialize()); + qDebug("DeviceUISet::saveMIMOChannelSettings: saving channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelURI)); + preset->addChannel(m_channelInstanceRegistrations[i].m_channelURI, m_channelInstanceRegistrations[i].m_gui->serialize()); } } else @@ -414,3 +425,15 @@ bool DeviceUISet::ChannelInstanceRegistration::operator<(const ChannelInstanceRe } } +void DeviceUISet::handleChannelGUIClosing(ChannelGUI* channelGUI) +{ + for (ChannelInstanceRegistrations::iterator it = m_channelInstanceRegistrations.begin(); it != m_channelInstanceRegistrations.end(); ++it) + { + if (it->m_gui == channelGUI) + { + it->m_channelAPI->destroy(); + m_channelInstanceRegistrations.erase(it); + break; + } + } +} diff --git a/sdrgui/device/deviceuiset.h b/sdrgui/device/deviceuiset.h index d3422c337..1f67ba869 100644 --- a/sdrgui/device/deviceuiset.h +++ b/sdrgui/device/deviceuiset.h @@ -18,6 +18,7 @@ #ifndef SDRGUI_DEVICE_DEVICEUISET_H_ #define SDRGUI_DEVICE_DEVICEUISET_H_ +#include #include #include @@ -38,8 +39,9 @@ class ChannelAPI; class ChannelGUI; class Preset; -class SDRGUI_API DeviceUISet +class SDRGUI_API DeviceUISet : public QObject { + Q_OBJECT public: SpectrumVis *m_spectrumVis; GLSpectrum *m_spectrum; @@ -72,9 +74,6 @@ public: void registerRxChannelInstance(const QString& channelName, ChannelAPI *channelAPI, ChannelGUI* channelGUI); void registerTxChannelInstance(const QString& channelName, ChannelAPI *channelAPI, ChannelGUI* channelGUI); void registerChannelInstance(const QString& channelName, ChannelAPI *channelAPI, ChannelGUI* channelGUI); - void removeRxChannelInstance(ChannelGUI* channelGUI); - void removeTxChannelInstance(ChannelGUI* channelGUI); - void removeChannelInstance(ChannelGUI* channelGUI); // These are the number of channel types available for selection void setNumberOfAvailableRxChannels(int number) { m_nbAvailableRxChannels = number; } @@ -87,22 +86,22 @@ public: private: struct ChannelInstanceRegistration { - QString m_channelName; + QString m_channelURI; ChannelAPI *m_channelAPI; ChannelGUI* m_gui; int m_channelType; ChannelInstanceRegistration() : - m_channelName(), - m_channelAPI(nullptr), + m_channelURI(), m_gui(nullptr), + m_channelAPI(nullptr), m_channelType(0) { } ChannelInstanceRegistration(const QString& channelName, ChannelAPI *channelAPI, ChannelGUI* channelGUI, int channelType) : - m_channelName(channelName), - m_channelAPI(channelAPI), + m_channelURI(channelName), m_gui(channelGUI), + m_channelAPI(channelAPI), m_channelType(channelType) { } @@ -118,6 +117,9 @@ private: int m_nbAvailableRxChannels; //!< Number of Rx channels available for selection int m_nbAvailableTxChannels; //!< Number of Tx channels available for selection int m_nbAvailableMIMOChannels; //!< Number of MIMO channels available for selection + +private slots: + void handleChannelGUIClosing(ChannelGUI* channelGUI); }; diff --git a/sdrgui/feature/featureuiset.cpp b/sdrgui/feature/featureuiset.cpp index e4ce463e2..148f33e9d 100644 --- a/sdrgui/feature/featureuiset.cpp +++ b/sdrgui/feature/featureuiset.cpp @@ -49,23 +49,11 @@ void FeatureUISet::registerFeatureInstance(const QString& featureURI, FeatureGUI featureGUI, &FeatureGUI::closing, this, - [=](){ this->handleClosingFeatureGUI(featureGUI, feature); }, + [=](){ this->handleClosingFeatureGUI(featureGUI); }, Qt::QueuedConnection ); } -void FeatureUISet::removeFeatureInstance(FeatureGUI* featureGUI) -{ - for (FeatureInstanceRegistrations::iterator it = m_featureInstanceRegistrations.begin(); it != m_featureInstanceRegistrations.end(); ++it) - { - if (it->m_gui == featureGUI) - { - m_featureInstanceRegistrations.erase(it); - break; - } - } -} - // sort by name bool FeatureUISet::FeatureInstanceRegistration::operator<(const FeatureInstanceRegistration& other) const { @@ -179,8 +167,15 @@ void FeatureUISet::saveFeatureSetSettings(FeatureSetPreset *preset) } -void FeatureUISet::handleClosingFeatureGUI(FeatureGUI *featureGUI, Feature *feature) +void FeatureUISet::handleClosingFeatureGUI(FeatureGUI *featureGUI) { - removeFeatureInstance(featureGUI); - feature->destroy(); + for (FeatureInstanceRegistrations::iterator it = m_featureInstanceRegistrations.begin(); it != m_featureInstanceRegistrations.end(); ++it) + { + if (it->m_gui == featureGUI) + { + it->m_feature->destroy(); + m_featureInstanceRegistrations.erase(it); + break; + } + } } diff --git a/sdrgui/feature/featureuiset.h b/sdrgui/feature/featureuiset.h index f4d452ee1..049f405c1 100644 --- a/sdrgui/feature/featureuiset.h +++ b/sdrgui/feature/featureuiset.h @@ -42,7 +42,6 @@ public: void addRollupWidget(QWidget *widget); //!< Add feature rollup widget to feature window int getNumberOfFeatures() const { return m_featureInstanceRegistrations.size(); } void registerFeatureInstance(const QString& featureURI, FeatureGUI* featureGUI, Feature *feature); - void removeFeatureInstance(FeatureGUI* featureGUI); void deleteFeature(int featureIndex); const Feature *getFeatureAt(int featureIndex) const; Feature *getFeatureAt(int featureIndex); @@ -81,7 +80,7 @@ private: void freeFeatures(); private slots: - void handleClosingFeatureGUI(FeatureGUI *featureGUI, Feature *feature); + void handleClosingFeatureGUI(FeatureGUI *featureGUI); }; #endif // SDRGUI_FEATURE_FEATUREUISET_H_ diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 54256d0ff..58083ee6a 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -1924,13 +1924,6 @@ void MainWindow::channelAddClicked(int channelIndex) pluginInterface->createRxChannel(deviceUI->m_deviceAPI, &rxChannel, &channelAPI); ChannelGUI *gui = pluginInterface->createRxChannelGUI(deviceUI, rxChannel); deviceUI->registerRxChannelInstance(channelAPI->getURI(), channelAPI, gui); - QObject::connect( - gui, - &ChannelGUI::closing, - this, - [=](){ this->handleClosingRxChannelGUI(deviceUI, gui); }, - Qt::QueuedConnection - ); } else if (deviceUI->m_deviceSinkEngine) // sink device => Tx channels { @@ -1941,13 +1934,6 @@ void MainWindow::channelAddClicked(int channelIndex) pluginInterface->createTxChannel(deviceUI->m_deviceAPI, &txChannel, &channelAPI); ChannelGUI *gui = pluginInterface->createTxChannelGUI(deviceUI, txChannel); deviceUI->registerTxChannelInstance(channelAPI->getURI(), channelAPI, gui); - QObject::connect( - gui, - &ChannelGUI::closing, - this, - [=](){ this->handleClosingTxChannelGUI(deviceUI, gui); }, - Qt::QueuedConnection - ); } else if (deviceUI->m_deviceMIMOEngine) // MIMO device => all possible channels. Depends on index range { @@ -1965,13 +1951,6 @@ void MainWindow::channelAddClicked(int channelIndex) pluginInterface->createRxChannel(deviceUI->m_deviceAPI, &rxChannel, &channelAPI); ChannelGUI *gui = pluginInterface->createRxChannelGUI(deviceUI, rxChannel); deviceUI->registerRxChannelInstance(channelAPI->getURI(), channelAPI, gui); - QObject::connect( - gui, - &ChannelGUI::closing, - this, - [=](){ this->handleClosingRxChannelGUI(deviceUI, gui); }, - Qt::QueuedConnection - ); } else if (channelIndex < nbRxChannels + nbTxChannels) { @@ -1982,13 +1961,6 @@ void MainWindow::channelAddClicked(int channelIndex) pluginInterface->createTxChannel(deviceUI->m_deviceAPI, &txChannel, &channelAPI); ChannelGUI *gui = pluginInterface->createTxChannelGUI(deviceUI, txChannel); deviceUI->registerTxChannelInstance(channelAPI->getURI(), channelAPI, gui); - QObject::connect( - gui, - &ChannelGUI::closing, - this, - [=](){ this->handleClosingTxChannelGUI(deviceUI, gui); }, - Qt::QueuedConnection - ); } } } @@ -2177,18 +2149,3 @@ void MainWindow::commandKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifie } } } - -void MainWindow::handleClosingRxChannelGUI(DeviceUISet *deviceUISet, ChannelGUI *gui) -{ - deviceUISet->removeRxChannelInstance(gui); -} - -void MainWindow::handleClosingTxChannelGUI(DeviceUISet *deviceUISet, ChannelGUI *gui) -{ - deviceUISet->removeTxChannelInstance(gui); -} - -void MainWindow::handleClosingMIMOChannelGUI(DeviceUISet *deviceUISet, ChannelGUI *gui) -{ - deviceUISet->removeChannelInstance(gui); -} diff --git a/sdrgui/mainwindow.h b/sdrgui/mainwindow.h index 6e7047a71..0b24cf96f 100644 --- a/sdrgui/mainwindow.h +++ b/sdrgui/mainwindow.h @@ -533,9 +533,6 @@ private slots: void tabInputViewIndexChanged(); void tabChannelsIndexChanged(); void commandKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release); - void handleClosingRxChannelGUI(DeviceUISet *deviceUISet, ChannelGUI *gui); - void handleClosingTxChannelGUI(DeviceUISet *deviceUISet, ChannelGUI *gui); - void handleClosingMIMOChannelGUI(DeviceUISet *deviceUISet, ChannelGUI *gui); }; #endif // INCLUDE_MAINWINDOW_H