diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-11-19 10:28:39 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-11-19 22:04:38 +0100 |
| commit | 360ef4e884db56e3cd228593bbc562727fbd41cd (patch) | |
| tree | b14cee4fb2ef51fa8c468c01a996359d18e73de5 | |
| parent | ddab4c862af610417eeb8e1510f3ff20aaa9d57c (diff) | |
PySide6: Fix crash when connecting slot after disconnecting non-existent connection to same slot
Add a null-check.
Fixes: PYSIDE-1715
Pick-to: 6.2 5.15
Change-Id: I0fc8c1b051b04eacd6bd75542ceaf9f23a825cab
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| -rw-r--r-- | sources/pyside6/libpyside/globalreceiverv2.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sources/pyside6/libpyside/globalreceiverv2.cpp b/sources/pyside6/libpyside/globalreceiverv2.cpp index c935d1180..0fe67db37 100644 --- a/sources/pyside6/libpyside/globalreceiverv2.cpp +++ b/sources/pyside6/libpyside/globalreceiverv2.cpp @@ -299,8 +299,10 @@ void GlobalReceiverV2::notify() const QSet<const QObject *> objSet(m_refs.cbegin(), m_refs.cend()); Py_BEGIN_ALLOW_THREADS for (const QObject *o : objSet) { - QMetaObject::disconnect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID); - QMetaObject::connect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID); + if (o) { + QMetaObject::disconnect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID); + QMetaObject::connect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID); + } } Py_END_ALLOW_THREADS } |
