X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBasics%2FPythonCppUtils.hxx;h=93a3cfb5939dfd720ba2698ded99d77064f0fe14;hb=1bbffef73eeeb5b2a14d8fc7bdf91affdafae664;hp=41a286dc0f36c0574426db2c30b4f4873ff2ec1d;hpb=2454295251ef7ee0d71a100597d9428da1247f1e;p=modules%2Fkernel.git diff --git a/src/Basics/PythonCppUtils.hxx b/src/Basics/PythonCppUtils.hxx index 41a286dc0..93a3cfb59 100644 --- a/src/Basics/PythonCppUtils.hxx +++ b/src/Basics/PythonCppUtils.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2021-2022 CEA/DEN, EDF R&D +// Copyright (C) 2021-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -36,6 +36,7 @@ public: AutoPyRef(PyObject *pyobj=nullptr):_pyobj(pyobj) { } ~AutoPyRef() { release(); } AutoPyRef(const AutoPyRef& other):_pyobj(other._pyobj) { if(_pyobj) Py_XINCREF(_pyobj); } + AutoPyRef(AutoPyRef&& other) = default; AutoPyRef& operator=(const AutoPyRef& other) { if(_pyobj==other._pyobj) return *this; release(); _pyobj=other._pyobj; Py_XINCREF(_pyobj); return *this; } operator PyObject *() { return _pyobj; } void set(PyObject *pyobj) { if(pyobj==_pyobj) return ; release(); _pyobj=pyobj; }