diff options
author | Pankaj Pandey <pankaj86@gmail.com> | 2013-09-29 18:33:55 +0530 |
---|---|---|
committer | John Ehresman <jpe@wingware.com> | 2014-04-15 23:24:40 +0200 |
commit | 4c5cc426a4841657d25b70df4080c220ed16bb7c (patch) | |
tree | c8e4d740f1f856653a562caf009195627f6bc1ab | |
parent | 10ce3bcbcdcb7e846c21c3f4055968a33124fd01 (diff) |
Fix PYSIDE-190
QCoreApplication would deadlock on exit if the global
QThreadPool.globalInstance() is running a QRunnable with python
code because the destroyQCoreApplication function would not
release the the GIL which `delete`ing the QCoreApplication.
Change-Id: I7b8a3bbd33f86050368a9357fa93e25a642b4ac5
Reviewed-by: John Ehresman <jpe@wingware.com>
-rw-r--r-- | libpyside/pyside.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp index 4f26204b1..3d47b8691 100644 --- a/libpyside/pyside.cpp +++ b/libpyside/pyside.cpp @@ -151,7 +151,12 @@ void destroyQCoreApplication() bm.visitAllPyObjects(&destructionVisitor, &data); // in the end destroy app + // Allow threads because the destructor calls + // QThreadPool::globalInstance().waitForDone() which may deadlock on the GIL + // if there is a worker working with python objects. + Py_BEGIN_ALLOW_THREADS delete app; + Py_END_ALLOW_THREADS } struct TypeUserData { |