diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-02-10 12:36:00 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-13 10:40:03 +0100 |
commit | 113e9216844768152ebfe503e413db24fe53a1bf (patch) | |
tree | 61c4cff638094eebf6dcc5fea02abef5de9516bb /src/corelib/tools/qmap.h | |
parent | a2abc11b51864ea0bab4fdb3aa44f2ec7cf0cc15 (diff) |
Don't expect null d-pointer in destructors
The feature was introduced in commit 83497587b2 (2004, private history),
to allow static containers to remain uninitialized until needed.
This finishes reverting said commit. The feature had been silently
removed from QByteArray and QString in commit a5a0985476 (2004, private
history); removed from QList in aef03d80f7.
Change-Id: I9947be7758d5730d2d6e6eb2a8a308db6e9bef39
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/tools/qmap.h')
-rw-r--r-- | src/corelib/tools/qmap.h | 2 |
1 files changed, 1 insertions, 1 deletions
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 |