diff options
author | Cristian Adam <cristian.adam@nokia.com> | 2012-05-08 09:11:31 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-16 07:04:42 +0200 |
commit | d0f223b6ad20f628698c6a01b9fd8e0715d271d2 (patch) | |
tree | 2a6a3c0899395fb8c0e8dad2f95a025ee7cd00a9 /src/plugins/position/gypsy | |
parent | e057680b996d6854c9aee8f6504acc873f0e65ac (diff) | |
download | qtlocation-d0f223b6ad20f628698c6a01b9fd8e0715d271d2.tar.gz |
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 <alex.wilson@nokia.com>
Diffstat (limited to 'src/plugins/position/gypsy')
-rw-r--r-- | src/plugins/position/gypsy/qgeosatelliteinfosource_gypsy.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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, |