diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2022-06-13 12:16:26 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2022-07-14 19:34:46 +0200 |
commit | 2c81ba2df95cc07d5d147c8f3c7999c34848d274 (patch) | |
tree | 6924ccb7737e3d756699e606c91b4f8253f1f764 /src/corelib/thread/qthread_p.h | |
parent | 6db91c0df1900df2ddcd5abeb243b8852b02b7ab (diff) |
QThread: Clean up bindingStatusOrList if object gets deleted
Deal with the case that the object gets deleted between a call to
moveToThread and the start of the thread by removing the object from the
list in that case.
Fixes: QTBUG-104014
Pick-to: 6.4
Change-Id: Ib249b6e8e8dfbc4d1332bb99a57fa9d3cff16465
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/thread/qthread_p.h')
-rw-r--r-- | src/corelib/thread/qthread_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 63c518fb57..b647964056 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -108,6 +108,7 @@ public: // requires external synchronization: QBindingStatus *addObjectUnlessAlreadyStatus(QObject *object); + void removeObject(QObject *object); void setStatusAndClearList(QBindingStatus *status) noexcept; @@ -237,6 +238,7 @@ public: if that one has been set in the meantime */ QBindingStatus *addObjectWithPendingBindingStatusChange(QObject *obj); + void removeObjectWithPendingBindingStatusChange(QObject *obj); // manipulating m_statusOrPendingObjects requires mutex to be locked QtPrivate::BindingStatusOrList m_statusOrPendingObjects = {}; @@ -263,6 +265,7 @@ public: QBindingStatus* bindingStatus() { return m_bindingStatus; } QBindingStatus *addObjectWithPendingBindingStatusChange(QObject *) { return nullptr; } + void removeObjectWithPendingBindingStatusChange(QObject *) {} static void setCurrentThread(QThread *) { } static QAbstractEventDispatcher *createEventDispatcher(QThreadData *data); |