replace deprecated auto_ptr with unique_ptr

This commit is contained in:
wmayer
2016-09-22 13:01:20 +02:00
parent 1ce73dda96
commit f944ab3846
47 changed files with 129 additions and 129 deletions

View File

@@ -99,12 +99,12 @@ Py::Object DocumentProtectorPy::getattr(const char * attr)
}
else {
Py::Object obj = Py::PythonExtension<DocumentProtectorPy>::getattr(attr);
if (PyCFunction_Check(obj.ptr())) {
PyCFunctionObject* op = reinterpret_cast<PyCFunctionObject*>(obj.ptr());
if (!pycxx_handler)
pycxx_handler = op->m_ml->ml_meth;
op->m_ml->ml_meth = method_varargs_ext_handler;
}
if (PyCFunction_Check(obj.ptr())) {
PyCFunctionObject* op = reinterpret_cast<PyCFunctionObject*>(obj.ptr());
if (!pycxx_handler)
pycxx_handler = op->m_ml->ml_meth;
op->m_ml->ml_meth = method_varargs_ext_handler;
}
return obj;
}
}
@@ -239,7 +239,7 @@ int DocumentObjectProtectorPy::setattr(const char * attr, const Py::Object & val
throw Py::AttributeError(s_out.str());
}
Base::PyGILStateRelease unlock;
std::auto_ptr<App::Property> copy(static_cast<App::Property*>
std::unique_ptr<App::Property> copy(static_cast<App::Property*>
(prop->getTypeId().createInstance()));
if (PyObject_TypeCheck(value.ptr(), DocumentObjectProtectorPy::type_object())) {
copy->setPyObject(static_cast<const DocumentObjectProtectorPy*>(value.ptr())->getObject().ptr());