coverity#1371219 Missing move assignment operator
Change-Id: I72ed6082b561079b45e82d8258fa1abbe23117e2 Reviewed-on: https://gerrit.libreoffice.org/29228 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -102,6 +102,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyRef(const PyRef &r) : m(r.get()) { Py_XINCREF(m); }
|
PyRef(const PyRef &r) : m(r.get()) { Py_XINCREF(m); }
|
||||||
|
PyRef(PyRef &&r) : m(r.get()) { r.scratch(); }
|
||||||
|
|
||||||
~PyRef() { Py_XDECREF( m ); }
|
~PyRef() { Py_XDECREF( m ); }
|
||||||
|
|
||||||
@@ -121,6 +122,15 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PyRef& operator=(PyRef&& r)
|
||||||
|
{
|
||||||
|
PyObject *tmp = m;
|
||||||
|
m = r.get();
|
||||||
|
r.scratch();
|
||||||
|
Py_XDECREF(tmp);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator == ( const PyRef & r ) const
|
bool operator == ( const PyRef & r ) const
|
||||||
{
|
{
|
||||||
return r.get() == m;
|
return r.get() == m;
|
||||||
|
Reference in New Issue
Block a user