Added missing initialization and check of members in VOIPConfigPanel to fix crash at shutdown with enabled plugin VOIP

This commit is contained in:
thunder2 2021-12-29 13:56:31 +01:00
parent b700c451d4
commit 0ffb31be85

View file

@ -92,6 +92,9 @@ VOIPConfigPanel::VOIPConfigPanel(QWidget * parent, Qt::WindowFlags flags)
inputAudioProcessor = NULL; inputAudioProcessor = NULL;
inputAudioDevice = NULL; inputAudioDevice = NULL;
graph_source = nullptr;
videoInput = nullptr;
videoProcessor = nullptr;
qtTick = NULL; qtTick = NULL;
ui.qcbTransmit->addItem(tr("Continuous"), RsVOIP::AudioTransmitContinous); ui.qcbTransmit->addItem(tr("Continuous"), RsVOIP::AudioTransmitContinous);
@ -209,11 +212,16 @@ VOIPConfigPanel::~VOIPConfigPanel()
void VOIPConfigPanel::clearPipeline() void VOIPConfigPanel::clearPipeline()
{ {
if (qtTick) {
delete qtTick; delete qtTick;
qtTick = nullptr;
}
if (graph_source) {
graph_source->stop() ; graph_source->stop() ;
graph_source->setVideoInput(NULL) ; graph_source->setVideoInput(NULL) ;
graph_source=nullptr; // is deleted by setSource below. This is a bad design. graph_source=nullptr; // is deleted by setSource below. This is a bad design.
}
ui.voipBwGraph->setSource(nullptr); ui.voipBwGraph->setSource(nullptr);
@ -225,8 +233,10 @@ void VOIPConfigPanel::clearPipeline()
videoInput = nullptr; videoInput = nullptr;
} }
if (videoProcessor) {
delete videoProcessor; delete videoProcessor;
videoProcessor = nullptr; videoProcessor = nullptr;
}
if (inputAudioDevice) { if (inputAudioDevice) {
inputAudioDevice->stop(); inputAudioDevice->stop();