Commit e626b173 authored by Gus Grubba's avatar Gus Grubba Committed by GitHub

Merge pull request #3748 from dogmaphobic/setActiveVehicleCrash

Fixing a crash bug where a leaving vehicle was not being properly 
parents 47b1c7e7 f0f739f3
...@@ -129,19 +129,18 @@ LogDownloadController::_processDownload() ...@@ -129,19 +129,18 @@ LogDownloadController::_processDownload()
void void
LogDownloadController::_setActiveVehicle(Vehicle* vehicle) LogDownloadController::_setActiveVehicle(Vehicle* vehicle)
{ {
if((_uas && vehicle && _uas == vehicle->uas()) || !vehicle ) { if(_uas) {
return;
}
_vehicle = vehicle;
if (_uas) {
_logEntriesModel.clear(); _logEntriesModel.clear();
disconnect(_uas, &UASInterface::logEntry, this, &LogDownloadController::_logEntry); disconnect(_uas, &UASInterface::logEntry, this, &LogDownloadController::_logEntry);
disconnect(_uas, &UASInterface::logData, this, &LogDownloadController::_logData); disconnect(_uas, &UASInterface::logData, this, &LogDownloadController::_logData);
_uas = NULL; _uas = NULL;
} }
_vehicle = vehicle;
if(_vehicle) {
_uas = vehicle->uas(); _uas = vehicle->uas();
connect(_uas, &UASInterface::logEntry, this, &LogDownloadController::_logEntry); connect(_uas, &UASInterface::logEntry, this, &LogDownloadController::_logEntry);
connect(_uas, &UASInterface::logData, this, &LogDownloadController::_logData); connect(_uas, &UASInterface::logData, this, &LogDownloadController::_logData);
}
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
......
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