Make QCoreApplicationPrivate's destructor virtual in bootstrapped builds

In a bootstrapped build QCAP does not inherit from QObjectPrivate,
meaning it won't get a polymorphic destructor, causing compile errors.
This is necessary in preparation to add virtuals to QCAP.

The "virtual" keyword is protected to avoid further warnings by
compilers or linters telling that it's unnecessary because the base
class' dtor is already virtual.

Change-Id: Ifbd218154f74b4f1d2f2c5a3ef1fc31970f1c24b
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Giuseppe D'Angelo 2019-05-29 12:16:19 +02:00
parent f5bfb7a8db
commit 0574d5dc8a
1 changed files with 5 additions and 0 deletions

View File

@ -84,6 +84,11 @@ public:
};
QCoreApplicationPrivate(int &aargc, char **aargv, uint flags);
// If not inheriting from QObjectPrivate: force this class to be polymorphic
#ifdef QT_NO_QOBJECT
virtual
#endif
~QCoreApplicationPrivate();
void init();