summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-01-26 18:36:30 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-01-26 18:36:30 (GMT)
commit256f9df327d13447ec110bbaebe813b86e57a610 (patch)
treeda58c29d58b3695406fc323ebc54483c0978d536 /Swiften/Network/BoostConnectionServer.h
parentc27c75917aea053baaa884638a3c056666a05602 (diff)
downloadswift-256f9df327d13447ec110bbaebe813b86e57a610.zip
swift-256f9df327d13447ec110bbaebe813b86e57a610.tar.bz2
Make boost io_service a shared object.
This should avoid problems when destroying an event loop containing timer or network events, after the network factory (and io_service object) has disappeared (i.e. at shutdown).
Diffstat (limited to 'Swiften/Network/BoostConnectionServer.h')
-rw-r--r--Swiften/Network/BoostConnectionServer.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Swiften/Network/BoostConnectionServer.h b/Swiften/Network/BoostConnectionServer.h
index 223f264..a45e598 100644
--- a/Swiften/Network/BoostConnectionServer.h
+++ b/Swiften/Network/BoostConnectionServer.h
@@ -25,7 +25,7 @@ namespace Swift {
UnknownError
};
- static ref create(int port, boost::asio::io_service* ioService, EventLoop* eventLoop) {
+ static ref create(int port, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) {
return ref(new BoostConnectionServer(port, ioService, eventLoop));
}
@@ -37,7 +37,7 @@ namespace Swift {
boost::signal<void (boost::optional<Error>)> onStopped;
private:
- BoostConnectionServer(int port, boost::asio::io_service* ioService, EventLoop* eventLoop);
+ BoostConnectionServer(int port, boost::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop);
void stop(boost::optional<Error> e);
void acceptNextConnection();
@@ -45,7 +45,7 @@ namespace Swift {
private:
int port_;
- boost::asio::io_service* ioService_;
+ boost::shared_ptr<boost::asio::io_service> ioService_;
EventLoop* eventLoop;
boost::asio::ip::tcp::acceptor* acceptor_;
};