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> | 2011-02-09 18:26:55 -0200 |
commit | 7909d294f51564499333be7d50cddfde8ff4b38a (patch) | |
tree | b57808d99fcce48d4af0de6d0ff34d9789a41b98 | |
parent | f25d227d6e540164e4f01103d025d36a0162b0a0 (diff) | |
download | pyside-7909d294f51564499333be7d50cddfde8ff4b38a.tar.gz pyside-7909d294f51564499333be7d50cddfde8ff4b38a.tar.xz pyside-7909d294f51564499333be7d50cddfde8ff4b38a.zip |
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 08c12f8..ae3ce3f 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 dd24a86..a2fd9dc 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 0000000..924ff19 --- /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_() |