aboutsummaryrefslogtreecommitdiffstats
path: root/libpyside
diff options
context:
space:
mode:
Diffstat (limited to 'libpyside')
-rw-r--r--libpyside/signalmanager.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 81ce14dc0..d9184eba7 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -452,22 +452,25 @@ int SignalManager::callPythonMetaMethod(const QMetaMethod& method, void** args,
pyArguments = parseArguments(method.parameterTypes(), args);
if (pyArguments) {
+ Shiboken::Conversions::SpecificConverter* retConverter = NULL;
+ const char* returnType = method.typeName();
+ if (returnType && std::strcmp("", returnType)) {
+ retConverter = new Shiboken::Conversions::SpecificConverter(returnType);
+ if (!retConverter || !*retConverter) {
+ PyErr_Format(PyExc_RuntimeError, "Can't find converter for '%s' to call Python meta method.", returnType);
+ PyErr_Print();
+ return -1;
+ }
+ }
+
Shiboken::AutoDecRef retval(PyObject_CallObject(pyMethod, pyArguments));
if (!isShortCuit && pyArguments)
Py_DECREF(pyArguments);
- if (!retval.isNull() && retval != Py_None && !PyErr_Occurred()) {
- const char* returnType = method.typeName();
- if (returnType && std::strcmp("", returnType)) {
- Shiboken::Conversions::SpecificConverter converter(returnType);
- if (converter)
- converter.toCpp(retval, args[0]);
- else
- PyErr_Format(PyExc_RuntimeError, "Can't find converter for '%s' to call Python meta method.", returnType);
-
- }
- }
+ if (!retval.isNull() && retval != Py_None && !PyErr_Occurred() && retConverter)
+ retConverter->toCpp(retval, args[0]);
+ delete retConverter;
}
if (PyErr_Occurred())