diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-02-09 18:03:09 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:53:56 -0300 |
commit | efad1c8b8cd10ad43207610ca7837308f4c024da (patch) | |
tree | 5588f7ad25fd8075c585d00c1306b65fa5a80e22 | |
parent | 079e6beb2d5152f33deb6c2c5144cbed302752a9 (diff) |
Fix bug 668 - "QFileSystemModel setRootPath stops application from quitting."
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Renato Araújo <renato.filho@openbossa.org>
-rw-r--r-- | libpyside/pyside.cpp | 2 | ||||
-rw-r--r-- | tests/QtGui/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtGui/bug_668.py | 21 |
3 files changed, 24 insertions, 0 deletions
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp index 08c12f80c..ae3ce3f2e 100644 --- a/libpyside/pyside.cpp +++ b/libpyside/pyside.cpp @@ -113,7 +113,9 @@ static void destructionVisitor(SbkObject* pyObj, void* data) if (pyObj != pyQApp && PyObject_TypeCheck(pyObj, pyQObjectType)) { if (Shiboken::Object::hasOwnership(pyObj) && Shiboken::Object::isValid(pyObj, false)) { + Py_BEGIN_ALLOW_THREADS Shiboken::callCppDestructor<QObject>(Shiboken::Object::cppPointer(pyObj, pyQObjectType)); + Py_END_ALLOW_THREADS Shiboken::Object::setValidCpp(pyObj, false); } } diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index dd24a86d2..a2fd9dc6e 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -37,6 +37,7 @@ PYSIDE_TEST(bug_653.py) PYSIDE_TEST(bug_660.py) PYSIDE_TEST(bug_662.py) PYSIDE_TEST(bug_667.py) +PYSIDE_TEST(bug_668.py) PYSIDE_TEST(customproxywidget_test.py) PYSIDE_TEST(deepcopy_test.py) PYSIDE_TEST(float_to_int_implicit_conversion_test.py) diff --git a/tests/QtGui/bug_668.py b/tests/QtGui/bug_668.py new file mode 100644 index 000000000..924ff1946 --- /dev/null +++ b/tests/QtGui/bug_668.py @@ -0,0 +1,21 @@ +# coding: utf-8 +from PySide.QtCore import * +from PySide.QtGui import * + +import sys + +class A(QMainWindow): + def __init__(self, parent=None): + super(A, self).__init__(parent) + a = QFileSystemModel(self) + a.setRootPath(QDir.homePath()) + + v = QTreeView(self) + v.setModel(a) + self.setCentralWidget(v) + +app = QApplication([]) +m = A() +m.show() +QTimer.singleShot(0, m.close) +app.exec_() |