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/BoostIOServiceThread.h
parentc27c75917aea053baaa884638a3c056666a05602 (diff)
downloadswift-contrib-256f9df327d13447ec110bbaebe813b86e57a610.zip
swift-contrib-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/BoostIOServiceThread.h')
-rw-r--r--Swiften/Network/BoostIOServiceThread.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Swiften/Network/BoostIOServiceThread.h b/Swiften/Network/BoostIOServiceThread.h
index 3cbea28..1f72049 100644
--- a/Swiften/Network/BoostIOServiceThread.h
+++ b/Swiften/Network/BoostIOServiceThread.h
@@ -8,6 +8,7 @@
#include <boost/asio.hpp>
#include <boost/thread.hpp>
+#include <boost/shared_ptr.hpp>
namespace Swift {
class BoostIOServiceThread {
@@ -15,7 +16,7 @@ namespace Swift {
BoostIOServiceThread();
~BoostIOServiceThread();
- boost::asio::io_service& getIOService() {
+ boost::shared_ptr<boost::asio::io_service> getIOService() {
return ioService_;
}
@@ -23,7 +24,7 @@ namespace Swift {
void doRun();
private:
- boost::asio::io_service ioService_;
- boost::thread thread_;
+ boost::shared_ptr<boost::asio::io_service> ioService_;
+ boost::thread* thread_;
};
}