[gnote] Create tags using std::make_shared



commit 4f484aedc54a3515f51d06b11e9aa1f998098d51
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Thu Dec 26 20:52:18 2019 +0200

    Create tags using std::make_shared

 src/tagmanager.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/tagmanager.cpp b/src/tagmanager.cpp
index 8b712d28..2b9c1e3d 100644
--- a/src/tagmanager.cpp
+++ b/src/tagmanager.cpp
@@ -111,7 +111,7 @@ namespace gnote {
         return iter->second;
       }
       else {
-        Tag::Ptr t(new Tag(tag_name));
+        Tag::Ptr t(std::make_shared<Tag>(tag_name));
         m_internal_tags [ t->normalized_name() ] = t;
         return t;
       }
@@ -125,7 +125,7 @@ namespace gnote {
 
       tag = get_tag (normalized_tag_name);
       if (!tag) {
-        tag.reset(new Tag (sharp::string_trim(tag_name)));
+        tag = std::make_shared<Tag>(sharp::string_trim(tag_name));
         iter = m_tags->append ();
         (*iter)[m_columns.m_tag] = tag;
         m_tag_map [tag->normalized_name()] = iter;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]