Browse Source

Fixed bug found during testing

Delete of last link would cause crash. Need to check for -1 which
signals no selection in combo box.
QGC4.4
Don Gagne 11 years ago
parent
commit
78b3107cb7
  1. 14
      src/ui/DebugConsole.cc

14
src/ui/DebugConsole.cc

@ -228,12 +228,14 @@ void DebugConsole::linkSelected(int linkId) @@ -228,12 +228,14 @@ void DebugConsole::linkSelected(int linkId)
m_ui->receiveText->clear();
// Connect new link
currLink = links[linkId];
connect(currLink, SIGNAL(bytesReceived(LinkInterface*,QByteArray)), this, SLOT(receiveBytes(LinkInterface*, QByteArray)));
connect(currLink, SIGNAL(connected(bool)), this, SLOT(setConnectionState(bool)));
connect(currLink,SIGNAL(communicationUpdate(QString,QString)),this,SLOT(linkStatusUpdate(QString,QString)));
setConnectionState(currLink->isConnected());
snapShotTimer.start();
if (linkId != -1) {
currLink = links[linkId];
connect(currLink, SIGNAL(bytesReceived(LinkInterface*,QByteArray)), this, SLOT(receiveBytes(LinkInterface*, QByteArray)));
connect(currLink, SIGNAL(connected(bool)), this, SLOT(setConnectionState(bool)));
connect(currLink,SIGNAL(communicationUpdate(QString,QString)),this,SLOT(linkStatusUpdate(QString,QString)));
setConnectionState(currLink->isConnected());
snapShotTimer.start();
}
}
/**

Loading…
Cancel
Save