From b1a0cf72f84803196539c4b0b03bfaeea9000d94 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 26 May 2015 22:16:25 +0200 Subject: [PATCH] QRunnable: declare dtor out-of-line and export class De-duplicates vtables and enables RTTI on this hierarchy. Change-Id: Ia60f4aa446f93ab91ea8780a3acc1118210ba7d5 Reported-by: Volker Krause Task-number: QTBUG-45582 Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira --- src/corelib/thread/qrunnable.cpp | 11 +++++++++++ src/corelib/thread/qrunnable.h | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/corelib/thread/qrunnable.cpp b/src/corelib/thread/qrunnable.cpp index 64a2613d27..04aa39a81e 100644 --- a/src/corelib/thread/qrunnable.cpp +++ b/src/corelib/thread/qrunnable.cpp @@ -31,6 +31,15 @@ ** ****************************************************************************/ +#include "qrunnable.h" + +QT_BEGIN_NAMESPACE + +QRunnable::~QRunnable() +{ + // Must be empty until ### Qt 6 +} + /*! \class QRunnable \inmodule QtCore @@ -98,3 +107,5 @@ \sa autoDelete(), QThreadPool */ + +QT_END_NAMESPACE diff --git a/src/corelib/thread/qrunnable.h b/src/corelib/thread/qrunnable.h index f00c58d51d..7233f33621 100644 --- a/src/corelib/thread/qrunnable.h +++ b/src/corelib/thread/qrunnable.h @@ -38,8 +38,7 @@ QT_BEGIN_NAMESPACE - -class QRunnable +class Q_CORE_EXPORT QRunnable { int ref; @@ -51,7 +50,7 @@ public: virtual void run() = 0; QRunnable() : ref(0) { } - virtual ~QRunnable() { } + virtual ~QRunnable(); bool autoDelete() const { return ref != -1; } void setAutoDelete(bool _autoDelete) { ref = _autoDelete ? 0 : -1; }