From d0f223b6ad20f628698c6a01b9fd8e0715d271d2 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 8 May 2012 09:11:31 +0200 Subject: Removed spurious pointer check before deletion In C++ it is perfectly valid to delete a null pointer. http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#faq-16.8 Change-Id: I60dc123b01e1ef015751143274579024e4c0becf Reviewed-by: Alex Wilson --- src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/plugins/position/gypsy') diff --git a/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp b/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp index 4c4606cb..5f229cbb 100644 --- a/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp +++ b/src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp @@ -151,8 +151,7 @@ QGeoSatelliteInfoSourceGypsy::QGeoSatelliteInfoSourceGypsy(QObject *parent) : QG void QGeoSatelliteInfoSourceGypsy::createEngine() { - if (m_engine) - delete m_engine; + delete m_engine; m_engine = new SatelliteGypsyEngine(this); } @@ -167,8 +166,7 @@ QGeoSatelliteInfoSourceGypsy::~QGeoSatelliteInfoSourceGypsy() g_object_unref(m_satellite); if (error) g_error_free(error); - if (m_engine) - delete m_engine; + delete m_engine; } void QGeoSatelliteInfoSourceGypsy::satellitesChanged(GypsySatellite *satellite, -- cgit v1.2.1