diff options
4 files changed, 5 insertions, 22 deletions
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index d5a83ada1..309cce420 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -1071,7 +1071,7 @@ qWarning() << "Module atexit not found for registering __moduleShutdown"; PyErr_Clear(); }else{ - regFunc = PyObject_GetAttrString(atexit, "register"); + regFunc.reset(PyObject_GetAttrString(atexit, "register")); if (regFunc.isNull()) { qWarning() << "Function atexit.register not found for registering __moduleShutdown"; PyErr_Clear(); diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml index ca3bbe361..1240e13c0 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml @@ -1735,7 +1735,7 @@ else qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to int."); } - %PYARG_0 = PySequence_Fast_GET_ITEM(seq.object(), 0); + %PYARG_0.reset(PySequence_Fast_GET_ITEM(seq.object(), 0)); Py_INCREF(%PYARG_0); // we need to incref, because "%PYARG_0 = ..." will decref the tuple and the tuple will be decrefed again at the end of this scope. } diff --git a/sources/pyside2/libpyside/signalmanager.cpp.in b/sources/pyside2/libpyside/signalmanager.cpp.in index 390f472db..ea0d692d8 100644 --- a/sources/pyside2/libpyside/signalmanager.cpp.in +++ b/sources/pyside2/libpyside/signalmanager.cpp.in @@ -205,9 +205,8 @@ QDataStream &operator>>(QDataStream& in, PyObjectWrapper& myObj) in >> repr; Shiboken::AutoDecRef pyCode(PyBytes_FromStringAndSize(repr.data(), repr.size())); Shiboken::AutoDecRef value(PyObject_CallFunctionObjArgs(eval_func, pyCode.object(), 0)); - if (!value.object()) { - value = Py_None; - } + if (!value.object()) + value.reset(Py_None); myObj = PyObjectWrapper(value); return in; } diff --git a/sources/shiboken2/libshiboken/autodecref.h b/sources/shiboken2/libshiboken/autodecref.h index 0af66624e..5e36a93c3 100644 --- a/sources/shiboken2/libshiboken/autodecref.h +++ b/sources/shiboken2/libshiboken/autodecref.h @@ -43,11 +43,6 @@ #include "sbkpython.h" #include "basewrapper.h" -#ifdef _MSC_VER -__pragma(warning(push)) -__pragma(warning(disable:4522)) // warning: C4522: 'Shiboken::AutoDecRef': multiple assignment operators specified -#endif - struct SbkObject; namespace Shiboken { @@ -97,20 +92,9 @@ public: } /** - * Decref the current borrowed python reference and take the reference - * borrowed by \p other, so other.isNull() will return true. - */ - void operator=(AutoDecRef& other) - { - Py_XDECREF(m_pyObj); - m_pyObj = other.m_pyObj; - other.m_pyObj = 0; - } - - /** * Decref the current borrowed python reference and borrow \p other. */ - void operator=(PyObject* other) + void reset(PyObject* other) { Py_XDECREF(m_pyObj); m_pyObj = other; |