aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason McCampbell (Enthought, Inc) <jmccampbell@enthought.com>2012-03-15 16:03:46 -0500
committerHugo Parente Lima <hugo.lima@openbossa.org>2012-04-19 01:06:40 +0200
commitc0c336399c0e30b1d7de52980b48c1ff0043860a (patch)
treeb6acdc10e823d9bb4d0c6d2524865381d5f00676
parent6f93c2029e9f076de1be7d8f674b3c99f664d0a1 (diff)
Bug pyside-35: GIL was not acquired in several important places.
Change-Id: I876732f90690d9679537611e9a71e33aa3a4e4e3 Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
-rw-r--r--libpyside/dynamicqmetaobject.cpp1
-rw-r--r--libpyside/globalreceiver.cpp3
-rw-r--r--libpyside/globalreceiverv2.cpp3
3 files changed, 7 insertions, 0 deletions
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index 4dfd80f1c..80d014e49 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -473,6 +473,7 @@ void DynamicQMetaObject::parsePythonType(PyTypeObject* type)
PyObject* value = 0;
Py_ssize_t pos = 0;
+ Shiboken::GilState gil;
typedef std::pair<const char*, PyObject*> PropPair;
QLinkedList<PropPair> properties;
diff --git a/libpyside/globalreceiver.cpp b/libpyside/globalreceiver.cpp
index ace1692e3..5639c3d52 100644
--- a/libpyside/globalreceiver.cpp
+++ b/libpyside/globalreceiver.cpp
@@ -71,6 +71,8 @@ using namespace PySide;
DynamicSlotData::DynamicSlotData(int id, PyObject* callback, GlobalReceiver* parent)
: m_id(id), m_pythonSelf(0), m_pyClass(0), m_weakRef(0), m_parent(parent)
{
+ Shiboken::GilState gil;
+
m_isMethod = PyMethod_Check(callback);
if (m_isMethod) {
//Can not store calback pointe because this will be destroyed at the end of the scope
@@ -97,6 +99,7 @@ PyObject* DynamicSlotData::call(PyObject* args)
PyObject* callback = m_callback;
//create a callback based on method data
+ Shiboken::GilState gil;
if (m_isMethod)
#ifdef IS_PY3K
callback = PyMethod_New(callback, m_pythonSelf);
diff --git a/libpyside/globalreceiverv2.cpp b/libpyside/globalreceiverv2.cpp
index 65a37ee10..ca72e3f8b 100644
--- a/libpyside/globalreceiverv2.cpp
+++ b/libpyside/globalreceiverv2.cpp
@@ -78,6 +78,8 @@ using namespace PySide;
DynamicSlotDataV2::DynamicSlotDataV2(PyObject* callback, GlobalReceiverV2* parent)
: m_pythonSelf(0), m_pyClass(0), m_weakRef(0), m_parent(parent)
{
+ Shiboken::GilState gil;
+
m_isMethod = PyMethod_Check(callback);
if (m_isMethod) {
//Can not store calback pointe because this will be destroyed at the end of the scope
@@ -271,6 +273,7 @@ const QMetaObject* GlobalReceiverV2::metaObject() const
int GlobalReceiverV2::qt_metacall(QMetaObject::Call call, int id, void** args)
{
+ Shiboken::GilState gil;
Q_ASSERT(call == QMetaObject::InvokeMetaMethod);
Q_ASSERT(id >= QObject::staticMetaObject.methodCount());