1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

TestSource: use queued connection for connecting worker's deleteLater. Fixes possible crash on exit

This commit is contained in:
f4exb 2023-02-03 02:14:54 +01:00
parent 46db55f1db
commit fdce34204f

View File

@ -690,7 +690,20 @@ void DemodAnalyzer::handleDataPipeToBeDeleted(int reason, QObject *object)
m_worker->getInputMessageQueue()->push(msg); m_worker->getInputMessageQueue()->push(msg);
} }
updateChannels(); m_availableChannels.remove((ChannelAPI*) object);
m_selectedChannel = nullptr; m_selectedChannel = nullptr;
if (getMessageQueueToGUI())
{
MsgReportChannels *msgToGUI = MsgReportChannels::create();
QList<DemodAnalyzerSettings::AvailableChannel>& msgAvailableChannels = msgToGUI->getAvailableChannels();
QHash<ChannelAPI*, DemodAnalyzerSettings::AvailableChannel>::iterator it = m_availableChannels.begin();
for (; it != m_availableChannels.end(); ++it) {
msgAvailableChannels.push_back(*it);
}
getMessageQueueToGUI()->push(msgToGUI);
}
} }
} }