aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside2/libpyside/signalmanager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/sources/pyside2/libpyside/signalmanager.cpp b/sources/pyside2/libpyside/signalmanager.cpp
index 0fe0d0092..8e8cc9f02 100644
--- a/sources/pyside2/libpyside/signalmanager.cpp
+++ b/sources/pyside2/libpyside/signalmanager.cpp
@@ -114,18 +114,24 @@ namespace PySide {
PyObjectWrapper::PyObjectWrapper()
:m_me(Py_None)
{
+ // PYSIDE-813: When PYSIDE-164 was solved by adding some thread allowance,
+ // this code was no longer protected. It was hard to find this connection.
+ // See the website https://bugreports.qt.io/browse/PYSIDE-813 for details.
+ Shiboken::GilState gil;
Py_XINCREF(m_me);
}
PyObjectWrapper::PyObjectWrapper(PyObject *me)
: m_me(me)
{
+ Shiboken::GilState gil;
Py_XINCREF(m_me);
}
PyObjectWrapper::PyObjectWrapper(const PyObjectWrapper &other)
: m_me(other.m_me)
{
+ Shiboken::GilState gil;
Py_XINCREF(m_me);
}
@@ -142,6 +148,7 @@ PyObjectWrapper::~PyObjectWrapper()
void PyObjectWrapper::reset(PyObject *o)
{
+ Shiboken::GilState gil;
Py_XINCREF(o);
Py_XDECREF(m_me);
m_me = o;