summaryrefslogtreecommitdiffstats
path: root/libpyside/pysidesignal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libpyside/pysidesignal.cpp')
-rw-r--r--libpyside/pysidesignal.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpyside/pysidesignal.cpp b/libpyside/pysidesignal.cpp
index 71d8c49..09cf884 100644
--- a/libpyside/pysidesignal.cpp
+++ b/libpyside/pysidesignal.cpp
@@ -465,11 +465,13 @@ PyObject* signalInstanceDisconnect(PyObject* self, PyObject* args)
PyObject* result = PyObject_CallObject(pyMethod, tupleArgs);
if (result == Py_True)
return result;
- else
- Py_DECREF(result);
+
+ Py_XDECREF(result);
}
- PyErr_Format(PyExc_RuntimeError, "Failed to disconnect signal %s.", source->d->signature);
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_RuntimeError, "Failed to disconnect signal %s.", source->d->signature);
+
return 0;
}