diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-07-09 09:28:19 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-07-10 06:44:07 +0200 |
| commit | 802f93fd6ba215cbee9588616741711a36ecff84 (patch) | |
| tree | 7bc9eeca6b426b8aaf86ade9472539950454e933 /sources/pyside6/libpyside/qobjectconnect.cpp | |
| parent | 0574e20b3afb0cf2291ca41233d4e6dcfcd88939 (diff) | |
libpyside: Prevent GlobalReceiver object creation for connections with contexts
This connection type always uses callables directly, no need to
create GlobalReceiver instances by calling getReceiver().
Amends acab25a3ccb836818e5089b23d40196bc7414b7a.
Change-Id: I3fbcaaa0495b455741a0d825f68ce6d98d2ce3aa
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/libpyside/qobjectconnect.cpp')
| -rw-r--r-- | sources/pyside6/libpyside/qobjectconnect.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/sources/pyside6/libpyside/qobjectconnect.cpp b/sources/pyside6/libpyside/qobjectconnect.cpp index ec19de491..7df9bf90b 100644 --- a/sources/pyside6/libpyside/qobjectconnect.cpp +++ b/sources/pyside6/libpyside/qobjectconnect.cpp @@ -275,13 +275,6 @@ QMetaObject::Connection qobjectConnectCallback(QObject *source, const char *sign if (signalIndex == -1) return {}; - // Extract receiver from callback - const GetReceiverResult receiver = getReceiver(source, signal + 1, callback); - if (receiver.receiver == nullptr && receiver.self == nullptr) - return {}; - - PySide::SignalManager &signalManager = PySide::SignalManager::instance(); - const QMetaMethod signalMethod = source->metaObject()->method(signalIndex); auto *slotObject = new PySideQSlotObject(callback, signalMethod.parameterTypes(), @@ -291,15 +284,8 @@ QMetaObject::Connection qobjectConnectCallback(QObject *source, const char *sign Py_BEGIN_ALLOW_THREADS // PYSIDE-2367, prevent threading deadlocks with connectNotify() connection = QObjectPrivate::connect(source, signalIndex, context, slotObject, type); Py_END_ALLOW_THREADS - if (!connection) { - if (receiver.usingGlobalReceiver) - signalManager.releaseGlobalReceiver(source, receiver.receiver); + if (!connection) return {}; - } - - Q_ASSERT(receiver.receiver); - if (receiver.usingGlobalReceiver) - signalManager.notifyGlobalReceiver(receiver.receiver); static_cast<FriendlyQObject *>(source)->connectNotify(signalMethod); return connection; |
