aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/libpyside
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-03-28 10:21:20 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2018-04-19 10:59:53 +0000
commita4690116881477d09f34f6b20b2ee0f31c06163d (patch)
tree846591be24c933141bf4c38fe917ca54ca0f0456 /sources/pyside2/libpyside
parent3895f37a83ba763cb54ea0af02282d4d7d54273b (diff)
Use XINCREF/XDECREF in PyObjectWrapper constructor
When emitting a None signal the PyObjectWrapper constructors in the signalmanager were not working properly, but using the safe macros to increase and decrease the references of the object solves the issue. Task-number: PYSIDE-17 Change-Id: I1871e5b8227d6ddc893afce2ab9b311b60649024 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/libpyside')
-rw-r--r--sources/pyside2/libpyside/signalmanager.cpp.in12
1 files changed, 6 insertions, 6 deletions
diff --git a/sources/pyside2/libpyside/signalmanager.cpp.in b/sources/pyside2/libpyside/signalmanager.cpp.in
index 08c57c21..ca176c69 100644
--- a/sources/pyside2/libpyside/signalmanager.cpp.in
+++ b/sources/pyside2/libpyside/signalmanager.cpp.in
@@ -116,19 +116,19 @@ namespace PySide {
PyObjectWrapper::PyObjectWrapper()
:m_me(Py_None)
{
- Py_INCREF(m_me);
+ Py_XINCREF(m_me);
}
PyObjectWrapper::PyObjectWrapper(PyObject* me)
: m_me(me)
{
- Py_INCREF(m_me);
+ Py_XINCREF(m_me);
}
PyObjectWrapper::PyObjectWrapper(const PyObjectWrapper &other)
: m_me(other.m_me)
{
- Py_INCREF(m_me);
+ Py_XINCREF(m_me);
}
PyObjectWrapper::~PyObjectWrapper()
@@ -139,13 +139,13 @@ PyObjectWrapper::~PyObjectWrapper()
return;
Shiboken::GilState gil;
- Py_DECREF(m_me);
+ Py_XDECREF(m_me);
}
PyObjectWrapper& PyObjectWrapper::operator=(const PySide::PyObjectWrapper& other)
{
- Py_INCREF(other.m_me);
- Py_DECREF(m_me);
+ Py_XINCREF(other.m_me);
+ Py_XDECREF(m_me);
m_me = other.m_me;
return *this;
}