summaryrefslogtreecommitdiffstats
path: root/libpyside
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@zytor.com>2012-02-28 00:47:34 -0300
committerPaulo Alcantara <pcacjr@zytor.com>2012-02-28 00:49:57 -0300
commit9261c52418a957e9ddc09b17ab08de7e2fcf5378 (patch)
treec722e9555a8d35c8b8f541d7ee6343999c5efe11 /libpyside
parent3f779b8307ebf4b6bdfbe777f41d76ce4ca25151 (diff)
downloadpyside-bug1126.tar.gz
pyside-bug1126.tar.xz
pyside-bug1126.zip
Fix BUG #1126 - "Segfault when exception is raised in signalInstanceDisconnect"HEADmasterbug1126
See http://bugs.pyside.org/show_bug.cgi?id=1126. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Diffstat (limited to 'libpyside')
-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;
}