diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-05-11 09:05:52 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-06-28 17:26:07 +0000 |
commit | be1b589cb9f147762a5a73d2b3a44778b7ae7502 (patch) | |
tree | 32c6e5c43f8088986dae19161975fcb2379d0be9 /src/corelib/thread/qrunnable.cpp | |
parent | 7a31911b795a3d07c6cba3af8436c3a38673689e (diff) |
De-inline QGenericRunnable overrides
Pins the vtable to a single TU and therefore prevents duplicate
vtables, -Wweak-vtables warnings and false-positive dynamic_casts.
This requires exporting QGenericRunnable, which hopefully won't
also export the nested class.
Pick-to: 6.6
Task-number: QTBUG-45582
Change-Id: Ie1f29d25b0dcdee7654c33c497e8e0350d12e311
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/corelib/thread/qrunnable.cpp')
-rw-r--r-- | src/corelib/thread/qrunnable.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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 |