Updates SignalManager and GlobalReceiver to acquire the GIL before calling Python.
Reviewed by Hugo Parente Lima <hugo.lima@openbossa.org>
This commit is contained in:
parent
55d3c6ef4e
commit
2f726de360
2 changed files with 4 additions and 0 deletions
|
|
@ -37,6 +37,7 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "signalmanager.h"
|
#include "signalmanager.h"
|
||||||
#include <autodecref.h>
|
#include <autodecref.h>
|
||||||
|
#include <gilstate.h>
|
||||||
#include "typeresolver.h"
|
#include "typeresolver.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -168,6 +169,7 @@ int GlobalReceiver::qt_metacall(QMetaObject::Call call, int id, void** args)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Shiboken::GilState gil;
|
||||||
int numArgs;
|
int numArgs;
|
||||||
PyObject* retval = 0;
|
PyObject* retval = 0;
|
||||||
PyObject* callback = data->callback();
|
PyObject* callback = data->callback();
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QMetaMethod>
|
#include <QMetaMethod>
|
||||||
#include <autodecref.h>
|
#include <autodecref.h>
|
||||||
|
#include <gilstate.h>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <typeresolver.h>
|
#include <typeresolver.h>
|
||||||
|
|
@ -262,6 +263,7 @@ int PySide::SignalManager::qt_metacall(QObject* object, QMetaObject::Call call,
|
||||||
QMetaObject::activate(object, id, args);
|
QMetaObject::activate(object, id, args);
|
||||||
} else {
|
} else {
|
||||||
// call python slot
|
// call python slot
|
||||||
|
Shiboken::GilState gil;
|
||||||
QList<QByteArray> paramTypes = method.parameterTypes();
|
QList<QByteArray> paramTypes = method.parameterTypes();
|
||||||
PyObject* self = Shiboken::BindingManager::instance().retrieveWrapper(object);
|
PyObject* self = Shiboken::BindingManager::instance().retrieveWrapper(object);
|
||||||
Shiboken::AutoDecRef preparedArgs(PyTuple_New(paramTypes.count()));
|
Shiboken::AutoDecRef preparedArgs(PyTuple_New(paramTypes.count()));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue