replace deprecated auto_ptr with unique_ptr
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user