diff --git a/src/ui/QGCConfigView.cc b/src/ui/QGCConfigView.cc index 16147f3e4b91ca8ec28b1e69a30c0c7a1cd24f75..f2167b63027f20323beb7c0457ed60c3f6464183 100644 --- a/src/ui/QGCConfigView.cc +++ b/src/ui/QGCConfigView.cc @@ -95,9 +95,11 @@ void QGCConfigView::activeUASChanged(UASInterface* uas) } } else { - //restore waiting label if we no longer have a connection - ui->gridLayout->addWidget(ui->waitingLabel); - ui->waitingLabel->setVisible(true); + if (ui->waitingLabel) { + //restore waiting label if we no longer have a connection + ui->gridLayout->addWidget(ui->waitingLabel); + ui->waitingLabel->setVisible(true); + } } } diff --git a/src/ui/uas/UASListWidget.cc b/src/ui/uas/UASListWidget.cc index e33cf132c2f38b93ce7a6aea5b8ce3d66e198985..e41d236dff1dc1d7f0a04a754f54554ce0d0394d 100644 --- a/src/ui/uas/UASListWidget.cc +++ b/src/ui/uas/UASListWidget.cc @@ -195,11 +195,6 @@ void UASListWidget::addUAS(UASInterface* uas) uasViews.insert(uas, newView); uasToBoxMapping[uas] = newBox; newBox->layout()->addWidget(newView); - - // Watch for when this widget is destroyed so that we can clean up the - // groupbox if necessary. - connect(newView, SIGNAL(destroyed(QObject*)), - this, SLOT(removeUASView(QObject*))); } } } @@ -243,6 +238,7 @@ void UASListWidget::removeUAS(UASInterface* uas) if (i.value() == box) { linkToBoxMapping.remove(i.key()); + break; } ++i; }