diff --git a/src/core/tools/qlinkedlist.h b/src/core/tools/qlinkedlist.h index e41c2baf3..be6092cf9 100644 --- a/src/core/tools/qlinkedlist.h +++ b/src/core/tools/qlinkedlist.h @@ -230,8 +230,6 @@ private: template inline QLinkedList::~QLinkedList() { - if (!d) - return; if (!d->ref.deref()) freeData(d); } diff --git a/src/core/tools/qmap.h b/src/core/tools/qmap.h index 53ecddfa7..ae49d993e 100644 --- a/src/core/tools/qmap.h +++ b/src/core/tools/qmap.h @@ -159,7 +159,7 @@ public: inline QMap() : d(&QMapData::shared_null) { d->ref.ref(); } inline QMap(const QMap &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 &operator=(const QMap &other); #ifdef Q_COMPILER_RVALUE_REFS diff --git a/src/core/tools/qvector.h b/src/core/tools/qvector.h index aeec40089..2f9c5b5b6 100644 --- a/src/core/tools/qvector.h +++ b/src/core/tools/qvector.h @@ -84,7 +84,7 @@ public: explicit QVector(int size); QVector(int size, const T &t); inline QVector(const QVector &v) : d(v.d) { d->ref.ref(); if (!d->sharable) detach_helper(); } - inline ~QVector() { if (!d) return; if (!d->ref.deref()) free(p); } + inline ~QVector() { if (!d->ref.deref()) free(p); } QVector &operator=(const QVector &v); #ifdef Q_COMPILER_RVALUE_REFS inline QVector operator=(QVector &&other)