[glom] PyGlomRelated: A small use of unique_ptr<> to avoid a naked new.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] PyGlomRelated: A small use of unique_ptr<> to avoid a naked new.
- Date: Fri, 5 Feb 2016 07:56:38 +0000 (UTC)
commit 7d5e8ac4d4eb5b5a702ced82838e35d46375446b
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Feb 4 23:30:22 2016 +0100
PyGlomRelated: A small use of unique_ptr<> to avoid a naked new.
glom/libglom/python_embed/py_glom_related.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glom/libglom/python_embed/py_glom_related.cc b/glom/libglom/python_embed/py_glom_related.cc
index e7f1ed9..4d43def 100644
--- a/glom/libglom/python_embed/py_glom_related.cc
+++ b/glom/libglom/python_embed/py_glom_related.cc
@@ -85,11 +85,11 @@ boost::python::object PyGlomRelated::getitem(const boost::python::object& cppite
if(from_key_field)
{
//Return a new RelatedRecord:
- auto pyRelatedRecord = new PyGlomRelatedRecord();
+ auto pyRelatedRecord = std::unique_ptr<PyGlomRelatedRecord>();
pyRelatedRecord->set_relationship(iterFind->second, from_key_value, record->m_document);
//Store it in the cache:
- boost::python::object objectRelatedRecord(pyRelatedRecord);
+ boost::python::object objectRelatedRecord(pyRelatedRecord.get());
m_map_relatedrecords[key] = objectRelatedRecord;
return objectRelatedRecord;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]