From f542e4e97431643b0e800048aea5d6a4644745bb 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] QGCMapEngine: 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/QtLocationPlugin/QGCMapEngine.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/QtLocationPlugin/QGCMapEngine.cpp b/src/QtLocationPlugin/QGCMapEngine.cpp index fd80a833b..41d21fc37 100644 --- a/src/QtLocationPlugin/QGCMapEngine.cpp +++ b/src/QtLocationPlugin/QGCMapEngine.cpp @@ -60,10 +60,8 @@ getQGCMapEngine() void destroyMapEngine() { - if(kMapEngine) { - delete kMapEngine; - kMapEngine = nullptr; - } + delete kMapEngine; + kMapEngine = nullptr; } //----------------------------------------------------------------------------- @@ -105,8 +103,8 @@ QGCMapEngine::~QGCMapEngine() { _worker.quit(); _worker.wait(); - if(_urlFactory) - delete _urlFactory; + delete _urlFactory; + _urlFactory = nullptr; } //----------------------------------------------------------------------------- @@ -373,8 +371,8 @@ int QGCMapEngine::concurrentDownloads(QString type) { Q_UNUSED(type); - // TODO : We may want different values depending on - // the provider here, let it like this as all provider are set to 12 + // TODO : We may want different values depending on + // the provider here, let it like this as all provider are set to 12 // at the moment return 12; } @@ -408,4 +406,3 @@ QGCMapEngine::_internetStatus(bool active) } // Resolution math: https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Resolution_and_Scale - -- 2.22.0