aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2017-01-16 13:28:44 +0100
committerChristian Tismer <tismer@stackless.com>2017-01-16 17:11:51 +0000
commitf1212c82adf77d604ca5a96a926f280abcbdfda6 (patch)
tree956ef5d467331025249317016fb80e6750f2a123
parent2f64d1ec7e8a30e6caafe54de03325cde3a80f4d (diff)
Fix “Fix Segfault when using connect”
There has been an over-done correction in this issue. The issue was solved, but I also “corrected” the function “getFromType”: - I added a check for a valid object. This was wrong, it is allowed to return a null object. - I adjusted the refcount, because PyDict_GetItem returns a borrowed ref. But this was correct, since the caller added a reference. I have run all tests. The result is identical before and after my change. It was necessary to treat this case before the end of PYSIDE-315, because the new test code from Mingxiang of today hits exactly this bug. Task-number: PYSIDE-79 Task-number: PYSIDE-315 Change-Id: Id489e106a5ee7410ed32b5c4bd21d4b98e4e97a7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--libpyside/pysideproperty.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/libpyside/pysideproperty.cpp b/libpyside/pysideproperty.cpp
index 9bdbf387..07b9dfae 100644
--- a/libpyside/pysideproperty.cpp
+++ b/libpyside/pysideproperty.cpp
@@ -339,12 +339,7 @@ static PyObject* getFromType(PyTypeObject* type, PyObject* name)
if (attr)
return attr;
}
- // PYSIDE-79: needed to capture this code path - attr not found
- return PyErr_Format(PyExc_RuntimeError, "*** Attribute '%s' not found!",
- Shiboken::String::toCString(name));
}
- Py_INCREF(attr); // PYSIDE-79: missing incref. PyDict_GetItem borrows a ref.
- // This was not central to the error, but caused sometimes later crashes.
return attr;
}