diff --git a/src/corelib/thread/qrunnable.cpp b/src/corelib/thread/qrunnable.cpp index 5418fc8ecf..bcb19d7af4 100644 --- a/src/corelib/thread/qrunnable.cpp +++ b/src/corelib/thread/qrunnable.cpp @@ -21,6 +21,17 @@ QRunnable *QRunnable::warnNullCallable() return nullptr; } + +QRunnable::QGenericRunnable::~QGenericRunnable() +{ + runHelper->destroy(); +} + +void QRunnable::QGenericRunnable::run() +{ + runHelper->run(); +} + /*! \class QRunnable \inmodule QtCore diff --git a/src/corelib/thread/qrunnable.h b/src/corelib/thread/qrunnable.h index 853228200f..f0dd0a582e 100644 --- a/src/corelib/thread/qrunnable.h +++ b/src/corelib/thread/qrunnable.h @@ -42,7 +42,7 @@ private: class QGenericRunnable; }; -class QRunnable::QGenericRunnable : public QRunnable +class Q_CORE_EXPORT QRunnable::QGenericRunnable : public QRunnable { // Type erasure, to only instantiate a non-virtual class per Callable: class HelperBase @@ -91,14 +91,9 @@ public: : runHelper(new Helper>(std::forward(c))) { } - ~QGenericRunnable() override - { - runHelper->destroy(); - } - void run() override - { - runHelper->run(); - } + ~QGenericRunnable() override; + + void run() override; }; namespace QtPrivate {