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 <volker.krause@kdab.com>
Task-number: QTBUG-45582
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2015-05-26 22:16:25 +02:00
parent a1c0a59ce6
commit b1a0cf72f8
2 changed files with 13 additions and 3 deletions

View File

@ -31,6 +31,15 @@
** **
****************************************************************************/ ****************************************************************************/
#include "qrunnable.h"
QT_BEGIN_NAMESPACE
QRunnable::~QRunnable()
{
// Must be empty until ### Qt 6
}
/*! /*!
\class QRunnable \class QRunnable
\inmodule QtCore \inmodule QtCore
@ -98,3 +107,5 @@
\sa autoDelete(), QThreadPool \sa autoDelete(), QThreadPool
*/ */
QT_END_NAMESPACE

View File

@ -38,8 +38,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class Q_CORE_EXPORT QRunnable
class QRunnable
{ {
int ref; int ref;
@ -51,7 +50,7 @@ public:
virtual void run() = 0; virtual void run() = 0;
QRunnable() : ref(0) { } QRunnable() : ref(0) { }
virtual ~QRunnable() { } virtual ~QRunnable();
bool autoDelete() const { return ref != -1; } bool autoDelete() const { return ref != -1; }
void setAutoDelete(bool _autoDelete) { ref = _autoDelete ? 0 : -1; } void setAutoDelete(bool _autoDelete) { ref = _autoDelete ? 0 : -1; }