summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-06-18 21:17:26 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-06-18 21:27:59 (GMT)
commit154bf14ac15fc7bff918c20814b29b5cc3bc5ba4 (patch)
tree28f18493bb6bc1cbf85b90f391daa6c4e1ecb3aa /Slimber
parentb763087e13f25e08aa51a6568b03727f136de34e (diff)
downloadswift-contrib-154bf14ac15fc7bff918c20814b29b5cc3bc5ba4.zip
swift-contrib-154bf14ac15fc7bff918c20814b29b5cc3bc5ba4.tar.bz2
Fix crash on reconnect.
BoostTimer isn't supposed to be constructed as a non-shared-ptr. Making constructor private to avoid this error in the future.
Diffstat (limited to 'Slimber')
-rw-r--r--Slimber/Server.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/Slimber/Server.cpp b/Slimber/Server.cpp
index 5b08d93..7ec3b66 100644
--- a/Slimber/Server.cpp
+++ b/Slimber/Server.cpp
@@ -56,9 +56,8 @@ Server::~Server() {
void Server::start() {
assert(!serverFromClientConnectionServer);
- serverFromClientConnectionServer =
- boost::shared_ptr<BoostConnectionServer>(new BoostConnectionServer(
- clientConnectionPort, &boostIOServiceThread.getIOService()));
+ serverFromClientConnectionServer = BoostConnectionServer::create(
+ clientConnectionPort, &boostIOServiceThread.getIOService());
serverFromClientConnectionServerSignalConnections.push_back(
serverFromClientConnectionServer->onNewConnection.connect(
boost::bind(&Server::handleNewClientConnection, this, _1)));
@@ -67,9 +66,8 @@ void Server::start() {
boost::bind(&Server::handleClientConnectionServerStopped, this, _1)));
assert(!serverFromNetworkConnectionServer);
- serverFromNetworkConnectionServer =
- boost::shared_ptr<BoostConnectionServer>(new BoostConnectionServer(
- linkLocalConnectionPort, &boostIOServiceThread.getIOService()));
+ serverFromNetworkConnectionServer = BoostConnectionServer::create(
+ linkLocalConnectionPort, &boostIOServiceThread.getIOService());
serverFromNetworkConnectionServerSignalConnections.push_back(
serverFromNetworkConnectionServer->onNewConnection.connect(
boost::bind(&Server::handleNewLinkLocalConnection, this, _1)));
@@ -256,7 +254,7 @@ void Server::handleElementReceived(boost::shared_ptr<Element> element, boost::sh
new LinkLocalConnector(
*service,
linkLocalServiceBrowser->getQuerier(),
- boost::shared_ptr<BoostConnection>(new BoostConnection(&boostIOServiceThread.getIOService()))));
+ BoostConnection::create(&boostIOServiceThread.getIOService())));
connector->onConnectFinished.connect(
boost::bind(&Server::handleConnectFinished, this, connector, _1));
connectors.push_back(connector);