From f0f739f3a43b01a89137fa3d698a30f0e1ccb4cf Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Fri, 8 Jul 2016 11:50:51 -0400 Subject: [PATCH] Fixing a crash bug where a leaving vehicle was not being properly cleaned up. --- src/ViewWidgets/LogDownloadController.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/ViewWidgets/LogDownloadController.cc b/src/ViewWidgets/LogDownloadController.cc index 4c8d614ae..dd2adb475 100644 --- a/src/ViewWidgets/LogDownloadController.cc +++ b/src/ViewWidgets/LogDownloadController.cc @@ -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); + } } //---------------------------------------------------------------------------------------- -- 2.22.0