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/BoostConnectionTest.cpp | |
parent | b763087e13f25e08aa51a6568b03727f136de34e (diff) | |
download | swift-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 'Swiften/QA/NetworkTest/BoostConnectionTest.cpp')
-rw-r--r-- | Swiften/QA/NetworkTest/BoostConnectionTest.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp index 28c8608..913f7c0 100644 --- a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp +++ b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp @@ -43,14 +43,14 @@ class BoostConnectionTest : public CppUnit::TestFixture { void testDestructor() { { - boost::shared_ptr<BoostConnection> testling(new BoostConnection(&boostIOServiceThread_->getIOService())); + BoostConnection::ref testling(BoostConnection::create(&boostIOServiceThread_->getIOService())); testling->connect(HostAddressPort(HostAddress(address, 4), 5222)); } } void testDestructor_PendingEvents() { { - boost::shared_ptr<BoostConnection> testling(new BoostConnection(&boostIOServiceThread_->getIOService())); + BoostConnection::ref testling(BoostConnection::create(&boostIOServiceThread_->getIOService())); testling->connect(HostAddressPort(HostAddress(address, 4), 5222)); while (!eventLoop_->hasEvents()) { Swift::sleep(10); @@ -60,7 +60,7 @@ class BoostConnectionTest : public CppUnit::TestFixture { } void testWrite() { - boost::shared_ptr<BoostConnection> testling(new BoostConnection(&boostIOServiceThread_->getIOService())); + BoostConnection::ref testling(BoostConnection::create(&boostIOServiceThread_->getIOService())); testling->onConnectFinished.connect(boost::bind(&BoostConnectionTest::doWrite, this, testling.get())); testling->onDataRead.connect(boost::bind(&BoostConnectionTest::handleDataRead, this, _1)); testling->onDisconnected.connect(boost::bind(&BoostConnectionTest::handleDisconnected, this)); |