summaryrefslogtreecommitdiff
path: root/src/lib/encode_server_finder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/encode_server_finder.cc')
-rw-r--r--src/lib/encode_server_finder.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/encode_server_finder.cc b/src/lib/encode_server_finder.cc
index 7491d9ef7..a017a0af1 100644
--- a/src/lib/encode_server_finder.cc
+++ b/src/lib/encode_server_finder.cc
@@ -28,6 +28,7 @@
#include "raw_convert.h"
#include <libcxml/cxml.h>
#include <boost/lambda/lambda.hpp>
+#include <boost/make_shared.hpp>
#include <iostream>
#include "i18n.h"
@@ -39,6 +40,7 @@ using std::cout;
using boost::shared_ptr;
using boost::scoped_array;
using boost::weak_ptr;
+using boost::make_shared;
EncodeServerFinder* EncodeServerFinder::_instance = 0;
@@ -151,7 +153,7 @@ catch (...)
void
EncodeServerFinder::start_accept ()
{
- shared_ptr<Socket> socket (new Socket ());
+ shared_ptr<Socket> socket = make_shared<Socket> ();
_listen_acceptor->async_accept (
socket->socket(),
boost::bind (&EncodeServerFinder::handle_accept, this, boost::asio::placeholders::error, socket)
@@ -174,7 +176,7 @@ EncodeServerFinder::handle_accept (boost::system::error_code ec, shared_ptr<Sock
socket->read (reinterpret_cast<uint8_t*> (buffer.get()), length);
string s (buffer.get());
- shared_ptr<cxml::Document> xml (new cxml::Document ("ServerAvailable"));
+ shared_ptr<cxml::Document> xml = make_shared<cxml::Document> ("ServerAvailable");
xml->read_string (s);
string const ip = socket->socket().remote_endpoint().address().to_string ();