Commit e354232b authored by Patrick José Pereira's avatar Patrick José Pereira

LogDownloadController: Remove pointer check before delete

Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent 2be698fd
...@@ -527,10 +527,9 @@ void LogDownloadController::downloadToDirectory(const QString& dir) ...@@ -527,10 +527,9 @@ void LogDownloadController::downloadToDirectory(const QString& dir)
//-- Stop listing just in case //-- Stop listing just in case
_receivedAllEntries(); _receivedAllEntries();
//-- Reset downloads, again just in case //-- Reset downloads, again just in case
if(_downloadData) { delete _downloadData;
delete _downloadData; _downloadData = nullptr;
_downloadData = 0;
}
_downloadPath = dir; _downloadPath = dir;
if(!_downloadPath.isEmpty()) { if(!_downloadPath.isEmpty()) {
if(!_downloadPath.endsWith(QDir::separator())) if(!_downloadPath.endsWith(QDir::separator()))
...@@ -573,10 +572,9 @@ LogDownloadController::_getNextSelected() ...@@ -573,10 +572,9 @@ LogDownloadController::_getNextSelected()
bool bool
LogDownloadController::_prepareLogDownload() LogDownloadController::_prepareLogDownload()
{ {
if(_downloadData) { delete _downloadData;
delete _downloadData; _downloadData = nullptr;
_downloadData = nullptr;
}
QGCLogEntry* entry = _getNextSelected(); QGCLogEntry* entry = _getNextSelected();
if(!entry) { if(!entry) {
return false; return false;
......
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