Browse Source

Merge pull request #1487 from DonLakeFlyer/HDDisplayCrash

Correctly handle UAS going away
QGC4.4
Don Gagne 10 years ago
parent
commit
3d4daff5fc
  1. 11
      src/ui/HDDisplay.cc

11
src/ui/HDDisplay.cc

@ -473,16 +473,17 @@ void HDDisplay::renderOverlay() @@ -473,16 +473,17 @@ void HDDisplay::renderOverlay()
*/
void HDDisplay::setActiveUAS(UASInterface* uas)
{
if (!uas)
return;
// Disconnect any previously connected active UAS
if (this->uas != NULL) {
removeSource(this->uas);
this->uas = NULL;
}
// Now connect the new UAS
addSource(uas);
this->uas = uas;
if (uas) {
// Now connect the new UAS
addSource(uas);
this->uas = uas;
}
}
/**

Loading…
Cancel
Save