diff options
author | Paulo Alcantara <pcacjr@zytor.com> | 2012-02-28 00:47:34 -0300 |
---|---|---|
committer | Paulo Alcantara <pcacjr@zytor.com> | 2012-02-28 00:49:57 -0300 |
commit | 9261c52418a957e9ddc09b17ab08de7e2fcf5378 (patch) | |
tree | c722e9555a8d35c8b8f541d7ee6343999c5efe11 | |
parent | 3f779b8307ebf4b6bdfbe777f41d76ce4ca25151 (diff) | |
download | pyside-master.tar.gz pyside-master.tar.xz pyside-master.zip |
See http://bugs.pyside.org/show_bug.cgi?id=1126.
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
-rw-r--r-- | libpyside/pysidesignal.cpp | 8 | ||||
-rw-r--r-- | tests/QtGui/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtGui/bug_1126.py | 24 |
3 files changed, 30 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; } diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index da3b4b6..f18b83c 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -83,6 +83,7 @@ PYSIDE_TEST(bug_1041.py) PYSIDE_TEST(bug_1048.py) PYSIDE_TEST(bug_1077.py) PYSIDE_TEST(bug_1124.py) +PYSIDE_TEST(bug_1126.py) PYSIDE_TEST(bug_1129.py) PYSIDE_TEST(customproxywidget_test.py) PYSIDE_TEST(deepcopy_test.py) diff --git a/tests/QtGui/bug_1126.py b/tests/QtGui/bug_1126.py new file mode 100644 index 0000000..749fac0 --- /dev/null +++ b/tests/QtGui/bug_1126.py @@ -0,0 +1,24 @@ +''' unit test for BUG #1126 ''' +''' see http://bugs.pyside.org/show_bug.cgi?id=1126 ''' + +from helper import UsesQApplication +import unittest +from PySide import QtCore, QtGui + +class SignalInstanceDisconnTestCase(UsesQApplication): + def testIt(self): + w = QtGui.QWidget() + w.deleteLater() + + def cb(*args): + self.app.quit() + + w.destroyed.connect(cb) + self.app.exec_() + try: + w.destroyed.disconnect(cb) + except RuntimeError: + pass + +if __name__ == "__main__": + unittest.main() |