use boost:make_shared more widely - refs #909

This commit is contained in:
Dane Springmeyer 2011-10-17 16:41:12 -07:00
parent f04bbb0b10
commit 8420e8a9c6
5 changed files with 7 additions and 5 deletions

View file

@ -26,6 +26,7 @@
#define CONNECTION_HPP #define CONNECTION_HPP
#include <mapnik/datasource.hpp> #include <mapnik/datasource.hpp>
#include <boost/make_shared.hpp>
extern "C" extern "C"
{ {
@ -98,7 +99,7 @@ class Connection
throw mapnik::datasource_exception( s.str() ); throw mapnik::datasource_exception( s.str() );
} }
return boost::shared_ptr<ResultSet>(new ResultSet(result)); return boost::make_shared<ResultSet>(result);
} }
std::string client_encoding() const std::string client_encoding() const

View file

@ -30,6 +30,7 @@
#include <mapnik/utils.hpp> #include <mapnik/utils.hpp>
#include "connection.hpp" #include "connection.hpp"
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
#ifdef MAPNIK_THREADSAFE #ifdef MAPNIK_THREADSAFE
@ -111,7 +112,7 @@ public:
if (pools_.find(creator.id())==pools_.end()) if (pools_.find(creator.id())==pools_.end())
{ {
return pools_.insert(std::make_pair(creator.id(), return pools_.insert(std::make_pair(creator.id(),
boost::shared_ptr<PoolType>(new PoolType(creator,initialSize,maxSize)))).second; boost::make_shared<PoolType>(creator,initialSize,maxSize))).second;
} }
return false; return false;

View file

@ -1115,7 +1115,7 @@ void cairo_renderer_base::process(shield_symbolizer const& sym,
} }
else else
{ {
marker.reset(boost::shared_ptr<mapnik::marker> (new mapnik::marker())); marker.reset(boost::make_shared<mapnik::marker>());
} }
if (text.length() > 0 && marker) if (text.length() > 0 && marker)

View file

@ -50,7 +50,7 @@ void grid_renderer<T>::process(point_symbolizer const& sym,
} }
else else
{ {
marker.reset(boost::shared_ptr<mapnik::marker> (new mapnik::marker())); marker.reset(boost::make_shared<mapnik::marker>());
} }
if (marker) if (marker)

View file

@ -89,7 +89,7 @@ void grid_renderer<T>::process(shield_symbolizer const& sym,
} }
else else
{ {
marker.reset(boost::shared_ptr<mapnik::marker> (new mapnik::marker())); marker.reset(boost::make_shared<mapnik::marker>());
} }
if (text.length() > 0 && marker) if (text.length() > 0 && marker)