diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-31 10:42:39 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-08-31 11:30:59 +0000 |
commit | fafd06df5f87f13df7136cc903f4d7e094510325 (patch) | |
tree | 1e02726db4b14f186d12eb399a3fcc0b1a95ae86 /sources/shiboken2/libshiboken/autodecref.h | |
parent | d0ef246be94375b247ec667d867d6978d513ddeb (diff) |
libshiboken: Replace AutoDecRef::operator= by a reset() method
The operators cause compiler warnings about multiple versions and
missing return types. Replace them by a reset() method (modeled after
std::unique_ptr, QScopedPointer).
This implies some changes in the templates.
Change-Id: I21a8fb9b84ecdfecf9671fa113f1bb3c6483166f
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken/autodecref.h')
-rw-r--r-- | sources/shiboken2/libshiboken/autodecref.h | 18 |
1 files changed, 1 insertions, 17 deletions
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; |