aboutsummaryrefslogtreecommitdiffstats
path: root/libpyside/pysidemetafunction.cpp
diff options
context:
space:
mode:
authorPankaj Pandey <pankaj86@gmail.com>2014-05-01 19:58:03 +0530
committerJohn Ehresman <jpe@wingware.com>2014-07-08 02:01:05 +0200
commit0c64d1b2c6e5e0951675ad9b22294db4a10741c7 (patch)
tree40a7680fd968bfb6c27f777b90d3a6aadd058db9 /libpyside/pysidemetafunction.cpp
parent8dfeddb3a679d2f6fdb1ae01f8eee77c9bec7edd (diff)
PYSIDE-164: Fix possible deadlock on signal connect/emitps-4.8-head
Signal connect/emit acquire a lock on the QObject, and can happen from python code (which has acquired the GIL) or internal QtCode (without acquiring the GIL). So we always need to release the GIL to prevent out-of-order acquisition of the locks causing deadlock. Change-Id: I1cf47a73c2b60627e322d8ef3fa4c3efdebd4c02 Reviewed-by: John Ehresman <jpe@wingware.com>
Diffstat (limited to 'libpyside/pysidemetafunction.cpp')
-rw-r--r--libpyside/pysidemetafunction.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libpyside/pysidemetafunction.cpp b/libpyside/pysidemetafunction.cpp
index 3a7d86ba7..98ce9366c 100644
--- a/libpyside/pysidemetafunction.cpp
+++ b/libpyside/pysidemetafunction.cpp
@@ -198,7 +198,9 @@ bool call(QObject* self, int methodIndex, PyObject* args, PyObject** retVal)
bool ok = i == numArgs;
if (ok) {
+ Py_BEGIN_ALLOW_THREADS
QMetaObject::metacall(self, QMetaObject::InvokeMetaMethod, method.methodIndex(), methArgs);
+ Py_END_ALLOW_THREADS
if (retVal) {
if (methArgs[0]) {