From 7b97e3ace8a0322c864368c75f7aff32e916208c Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 28 Sep 2014 22:35:08 -0700 Subject: [PATCH] unique_ptr for font_face_set --- include/mapnik/font_engine_freetype.hpp | 2 +- include/mapnik/text/face.hpp | 2 +- src/font_engine_freetype.cpp | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/mapnik/font_engine_freetype.hpp b/include/mapnik/font_engine_freetype.hpp index 095ad7cad..9ce3d62c9 100644 --- a/include/mapnik/font_engine_freetype.hpp +++ b/include/mapnik/font_engine_freetype.hpp @@ -47,7 +47,7 @@ namespace mapnik class stroker; using stroker_ptr = std::shared_ptr; class font_face_set; -using face_set_ptr = std::shared_ptr; +using face_set_ptr = std::unique_ptr; class font_face; using face_ptr = std::shared_ptr; diff --git a/include/mapnik/text/face.hpp b/include/mapnik/text/face.hpp index 0a4908ff0..78b2b74c6 100644 --- a/include/mapnik/text/face.hpp +++ b/include/mapnik/text/face.hpp @@ -98,7 +98,7 @@ public: private: std::vector faces_; }; -using face_set_ptr = std::shared_ptr; +using face_set_ptr = std::unique_ptr; // FT_Stroker wrapper diff --git a/src/font_engine_freetype.cpp b/src/font_engine_freetype.cpp index 265ea9eac..faf103632 100644 --- a/src/font_engine_freetype.cpp +++ b/src/font_engine_freetype.cpp @@ -28,6 +28,7 @@ #include #include #include +#include // boost #include @@ -353,7 +354,7 @@ face_ptr face_manager::get_face(std::string const& name) face_set_ptr face_manager::get_face_set(std::string const& name) { - face_set_ptr face_set = std::make_shared(); + face_set_ptr face_set = std::make_unique(); if (face_ptr face = get_face(name)) { face_set->add(face); @@ -364,7 +365,7 @@ face_set_ptr face_manager::get_face_set(std::string const& name) face_set_ptr face_manager::get_face_set(font_set const& fset) { std::vector const& names = fset.get_face_names(); - face_set_ptr face_set = std::make_shared(); + face_set_ptr face_set = std::make_unique(); for (auto const& name : names) { face_ptr face = get_face(name);