diff options
Diffstat (limited to 'sources/pyside2/libpyside')
-rw-r--r-- | sources/pyside2/libpyside/feature_select.cpp | 2 | ||||
-rw-r--r-- | sources/pyside2/libpyside/globalreceiverv2.cpp | 6 | ||||
-rw-r--r-- | sources/pyside2/libpyside/pysideslot.cpp | 13 |
3 files changed, 13 insertions, 8 deletions
diff --git a/sources/pyside2/libpyside/feature_select.cpp b/sources/pyside2/libpyside/feature_select.cpp index 7604f69aa..3011b3584 100644 --- a/sources/pyside2/libpyside/feature_select.cpp +++ b/sources/pyside2/libpyside/feature_select.cpp @@ -408,6 +408,8 @@ static inline PyObject *SelectFeatureSet(PyTypeObject *type) if (!SelectFeatureSetSubtype(sub_type, select_id)) break; } + // PYSIDE-1436: Clear all caches for the type and subtypes. + PyType_Modified(type); } return type->tp_dict; } diff --git a/sources/pyside2/libpyside/globalreceiverv2.cpp b/sources/pyside2/libpyside/globalreceiverv2.cpp index b16a923dd..88bba9338 100644 --- a/sources/pyside2/libpyside/globalreceiverv2.cpp +++ b/sources/pyside2/libpyside/globalreceiverv2.cpp @@ -291,8 +291,10 @@ void GlobalReceiverV2::notify() #endif 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 } diff --git a/sources/pyside2/libpyside/pysideslot.cpp b/sources/pyside2/libpyside/pysideslot.cpp index 7911b21de..660b93caf 100644 --- a/sources/pyside2/libpyside/pysideslot.cpp +++ b/sources/pyside2/libpyside/pysideslot.cpp @@ -134,11 +134,13 @@ int slotTpInit(PyObject *self, PyObject *args, PyObject *kw) PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */) { static PyObject *pySlotName = nullptr; - PyObject *callback; - callback = PyTuple_GetItem(args, 0); + PyObject *callback = nullptr; + + if (!PyArg_UnpackTuple(args, "Slot.__call__", 1, 1, &callback)) + return nullptr; Py_INCREF(callback); - if (Py_TYPE(callback)->tp_call != nullptr) { + if (PyCallable_Check(callback)) { PySideSlot *data = reinterpret_cast<PySideSlot *>(self); if (!data->slotData) @@ -147,7 +149,7 @@ PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */) if (data->slotData->name.isEmpty()) { // PYSIDE-198: Use PyObject_GetAttr instead of PepFunction_GetName to support Nuitka. AutoDecRef funcName(PyObject_GetAttr(callback, PyMagicName::name())); - data->slotData->name = String::toCString(funcName); + data->slotData->name = funcName.isNull() ? "<no name>" : String::toCString(funcName); } const QByteArray returnType = QMetaObject::normalizedType(data->slotData->resultType); const QByteArray signature = @@ -157,7 +159,7 @@ PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */) pySlotName = String::fromCString(PYSIDE_SLOT_LIST_ATTR); PyObject *pySignature = String::fromCString(signature); - PyObject *signatureList = 0; + PyObject *signatureList = nullptr; if (PyObject_HasAttr(callback, pySlotName)) { signatureList = PyObject_GetAttr(callback, pySlotName); } else { @@ -172,7 +174,6 @@ PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */) //clear data delete data->slotData; data->slotData = nullptr; - return callback; } return callback; } |