Commit 3afd1855 authored by Don Gagne's avatar Don Gagne

Correctly handle UAS going away

parent 9a141821
...@@ -473,16 +473,17 @@ void HDDisplay::renderOverlay() ...@@ -473,16 +473,17 @@ void HDDisplay::renderOverlay()
*/ */
void HDDisplay::setActiveUAS(UASInterface* uas) void HDDisplay::setActiveUAS(UASInterface* uas)
{ {
if (!uas)
return;
// Disconnect any previously connected active UAS // Disconnect any previously connected active UAS
if (this->uas != NULL) { if (this->uas != NULL) {
removeSource(this->uas); removeSource(this->uas);
this->uas = NULL;
} }
// Now connect the new UAS if (uas) {
addSource(uas); // Now connect the new UAS
this->uas = uas; addSource(uas);
this->uas = uas;
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment