summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-02-09 18:03:09 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:56 -0300
commitefad1c8b8cd10ad43207610ca7837308f4c024da (patch)
tree5588f7ad25fd8075c585d00c1306b65fa5a80e22
parent079e6beb2d5152f33deb6c2c5144cbed302752a9 (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.cpp2
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_668.py21
3 files changed, 24 insertions, 0 deletions
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index 08c12f80..ae3ce3f2 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 dd24a86d..a2fd9dc6 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 00000000..924ff194
--- /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_()