diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-06-18 21:17:26 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-06-18 21:27:59 (GMT) |
commit | 154bf14ac15fc7bff918c20814b29b5cc3bc5ba4 (patch) | |
tree | 28f18493bb6bc1cbf85b90f391daa6c4e1ecb3aa /Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp | |
parent | b763087e13f25e08aa51a6568b03727f136de34e (diff) | |
download | swift-154bf14ac15fc7bff918c20814b29b5cc3bc5ba4.zip swift-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 'Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp')
-rw-r--r-- | Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp index cf3535a..543e085 100644 --- a/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp +++ b/Swiften/QA/NetworkTest/BoostConnectionServerTest.cpp @@ -39,15 +39,15 @@ class BoostConnectionServerTest : public CppUnit::TestFixture { } void testConstructor_TwoServersOnSamePort() { - boost::shared_ptr<BoostConnectionServer> testling(new BoostConnectionServer(9999, &boostIOServiceThread_->getIOService())); - boost::shared_ptr<BoostConnectionServer> testling2(new BoostConnectionServer(9999, &boostIOServiceThread_->getIOService())); + BoostConnectionServer::ref testling(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService())); + BoostConnectionServer::ref testling2(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService())); } void testStart_Conflict() { - boost::shared_ptr<BoostConnectionServer> testling(new BoostConnectionServer(9999, &boostIOServiceThread_->getIOService())); + BoostConnectionServer::ref testling(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService())); testling->start(); - boost::shared_ptr<BoostConnectionServer> testling2(new BoostConnectionServer(9999, &boostIOServiceThread_->getIOService())); + BoostConnectionServer::ref testling2(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService())); testling2->onStopped.connect( boost::bind(&BoostConnectionServerTest::handleStopped, this, _1)); @@ -55,12 +55,12 @@ class BoostConnectionServerTest : public CppUnit::TestFixture { } void testStop() { - boost::shared_ptr<BoostConnectionServer> testling(new BoostConnectionServer(9999, &boostIOServiceThread_->getIOService())); + BoostConnectionServer::ref testling(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService())); testling->start(); testling->stop(); - boost::shared_ptr<BoostConnectionServer> testling2(new BoostConnectionServer(9999, &boostIOServiceThread_->getIOService())); + BoostConnectionServer::ref testling2(BoostConnectionServer::create(9999, &boostIOServiceThread_->getIOService())); testling2->start(); testling2->stop(); |