summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstringlist.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-04-15 11:31:20 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-04-16 09:46:00 +0000
commit198190b76baffce9b983d03749e64af6f8428e49 (patch)
tree2563051d164491839cb9926a1c5d8c96c20683c5 /src/corelib/tools/qstringlist.h
parentaea74dcaee2d6930e4d69cbda83088703b45816e (diff)
QList: make QListSpecialMethods dtors protected
QList publicly inherits from QListSpecialMethods. Thus, any specialisation of QListSpecialMethods should make their destructor protected, to avoid deletion through a pointer to QListSpecialMethods invoking UB. Change-Id: I7e317606f84826cc0faf1bfc05dee97da6eaf2eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qstringlist.h')
-rw-r--r--src/corelib/tools/qstringlist.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
index 89785208c8..8288e430fa 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/tools/qstringlist.h
@@ -57,6 +57,10 @@ class QStringList : public QList<QString>
template <> struct QListSpecialMethods<QString>
#endif
{
+#ifndef Q_QDOC
+protected:
+ ~QListSpecialMethods() {}
+#endif
public:
inline void sort(Qt::CaseSensitivity cs = Qt::CaseSensitive);
inline int removeDuplicates();