From e354232b52e301b77755ce81a29c8e9c13fb6c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Wed, 5 Feb 2020 17:28:18 -0300 Subject: [PATCH] LogDownloadController: Remove pointer check before delete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/AnalyzeView/LogDownloadController.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/AnalyzeView/LogDownloadController.cc b/src/AnalyzeView/LogDownloadController.cc index 392238c2f..9bd3dbc15 100644 --- a/src/AnalyzeView/LogDownloadController.cc +++ b/src/AnalyzeView/LogDownloadController.cc @@ -527,10 +527,9 @@ void LogDownloadController::downloadToDirectory(const QString& dir) //-- Stop listing just in case _receivedAllEntries(); //-- Reset downloads, again just in case - if(_downloadData) { - delete _downloadData; - _downloadData = 0; - } + delete _downloadData; + _downloadData = nullptr; + _downloadPath = dir; if(!_downloadPath.isEmpty()) { if(!_downloadPath.endsWith(QDir::separator())) @@ -573,10 +572,9 @@ LogDownloadController::_getNextSelected() bool LogDownloadController::_prepareLogDownload() { - if(_downloadData) { - delete _downloadData; - _downloadData = nullptr; - } + delete _downloadData; + _downloadData = nullptr; + QGCLogEntry* entry = _getNextSelected(); if(!entry) { return false; -- 2.22.0