summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 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_()