From 198190b76baffce9b983d03749e64af6f8428e49 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 15 Apr 2015 11:31:20 +0200 Subject: 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 --- src/corelib/tools/qstringlist.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib/tools/qstringlist.h') 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 template <> struct QListSpecialMethods #endif { +#ifndef Q_QDOC +protected: + ~QListSpecialMethods() {} +#endif public: inline void sort(Qt::CaseSensitivity cs = Qt::CaseSensitive); inline int removeDuplicates(); -- cgit v1.2.3