mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 21:20:31 -05:00 
			
		
		
		
	Corrected order of deletion of channel vs channel GUI. Fixes #1332
This commit is contained in:
		
							parent
							
								
									ef873c00bb
								
							
						
					
					
						commit
						bd7fd29de9
					
				@ -161,8 +161,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_channelAPI->destroy();
 | 
			
		||||
        m_channelInstanceRegistrations[i].m_gui->destroy();
 | 
			
		||||
        m_channelInstanceRegistrations[i].m_channelAPI->destroy();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    m_channelInstanceRegistrations.clear();
 | 
			
		||||
@ -176,8 +176,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_channelAPI->destroy();
 | 
			
		||||
        m_channelInstanceRegistrations[channelIndex].m_gui->destroy();
 | 
			
		||||
        m_channelInstanceRegistrations[channelIndex].m_channelAPI->destroy();
 | 
			
		||||
        m_channelInstanceRegistrations.removeAt(channelIndex);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -723,8 +723,14 @@ void DeviceUISet::handleChannelGUIClosing(ChannelGUI* channelGUI)
 | 
			
		||||
    {
 | 
			
		||||
        if (it->m_gui == channelGUI)
 | 
			
		||||
        {
 | 
			
		||||
            m_deviceSet->removeChannelInstance(it->m_channelAPI);
 | 
			
		||||
            it->m_channelAPI->destroy();
 | 
			
		||||
            ChannelAPI *channelAPI = it->m_channelAPI;
 | 
			
		||||
            m_deviceSet->removeChannelInstance(channelAPI);
 | 
			
		||||
            QObject::connect(
 | 
			
		||||
                channelGUI,
 | 
			
		||||
                &ChannelGUI::destroyed,
 | 
			
		||||
                this,
 | 
			
		||||
                [this, channelAPI](){ this->handleDeleteChannel(channelAPI); }
 | 
			
		||||
            );
 | 
			
		||||
            m_channelInstanceRegistrations.erase(it);
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
@ -736,6 +742,11 @@ void DeviceUISet::handleChannelGUIClosing(ChannelGUI* channelGUI)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DeviceUISet::handleDeleteChannel(ChannelAPI *channelAPI)
 | 
			
		||||
{
 | 
			
		||||
    channelAPI->destroy();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int DeviceUISet::webapiSpectrumSettingsGet(SWGSDRangel::SWGGLSpectrum& response, QString& errorMessage) const
 | 
			
		||||
{
 | 
			
		||||
    return m_spectrumVis->webapiSpectrumSettingsGet(response, errorMessage);
 | 
			
		||||
 | 
			
		||||
@ -158,6 +158,7 @@ private:
 | 
			
		||||
 | 
			
		||||
private slots:
 | 
			
		||||
    void handleChannelGUIClosing(ChannelGUI* channelGUI);
 | 
			
		||||
    void handleDeleteChannel(ChannelAPI *channelAPI);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user