From 0574d5dc8a10cb4281c6f53c3d2d3e49f2109a6a Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 29 May 2019 12:16:19 +0200 Subject: [PATCH] Make QCoreApplicationPrivate's destructor virtual in bootstrapped builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: MÃ¥rten Nordheim --- src/corelib/kernel/qcoreapplication_p.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index 14ca3efd7f..6ede5d1bc0 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -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();