diff options
-rw-r--r-- | src/corelib/tools/qlinkedlist.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qmap.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qvector.h | 2 |
3 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h index 1fa4eaabd0..28f190c7fa 100644 --- a/src/corelib/tools/qlinkedlist.h +++ b/src/corelib/tools/qlinkedlist.h @@ -241,8 +241,6 @@ private: template <typename T> inline QLinkedList<T>::~QLinkedList() { - if (!d) - return; if (!d->ref.deref()) free(d); } diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index a8306194d4..dc358a8106 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -179,7 +179,7 @@ public: inline QMap() : d(const_cast<QMapData *>(&QMapData::shared_null)) { } inline QMap(const QMap<Key, T> &other) : d(other.d) { d->ref.ref(); if (!d->sharable) detach(); } - inline ~QMap() { if (!d) return; if (!d->ref.deref()) freeData(d); } + inline ~QMap() { if (!d->ref.deref()) freeData(d); } QMap<Key, T> &operator=(const QMap<Key, T> &other); #ifdef Q_COMPILER_RVALUE_REFS diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index 22ce2a3d8a..6357c24621 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -126,7 +126,7 @@ public: } } - inline ~QVector() { if (!d) return; if (!d->ref.deref()) free(p); } + inline ~QVector() { if (!d->ref.deref()) free(p); } QVector<T> &operator=(const QVector<T> &v); #ifdef Q_COMPILER_RVALUE_REFS inline QVector<T> operator=(QVector<T> &&other) |