Skip to content

Commit

Permalink
Fixing a crash bug where a leaving vehicle was not being properly cle…
Browse files Browse the repository at this point in the history
…aned up.
  • Loading branch information
dogmaphobic committed Jul 8, 2016
1 parent e35cf4c commit f0f739f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/ViewWidgets/LogDownloadController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,18 @@ LogDownloadController::_processDownload()
void
LogDownloadController::_setActiveVehicle(Vehicle* vehicle)
{
if((_uas && vehicle && _uas == vehicle->uas()) || !vehicle ) {
return;
}
_vehicle = vehicle;
if (_uas) {
if(_uas) {
_logEntriesModel.clear();
disconnect(_uas, &UASInterface::logEntry, this, &LogDownloadController::_logEntry);
disconnect(_uas, &UASInterface::logData, this, &LogDownloadController::_logData);
_uas = NULL;
}
_uas = vehicle->uas();
connect(_uas, &UASInterface::logEntry, this, &LogDownloadController::_logEntry);
connect(_uas, &UASInterface::logData, this, &LogDownloadController::_logData);
_vehicle = vehicle;
if(_vehicle) {
_uas = vehicle->uas();
connect(_uas, &UASInterface::logEntry, this, &LogDownloadController::_logEntry);
connect(_uas, &UASInterface::logData, this, &LogDownloadController::_logData);
}
}

//----------------------------------------------------------------------------------------
Expand Down

0 comments on commit f0f739f

Please sign in to comment.