summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-05-24 13:15:31 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-05-24 18:16:22 (GMT)
commit23387492f571e8e6c46c6fa6196bf496249c9853 (patch)
tree2ad95f6072367496383195f83a12a5be8fa2da40 /Swiften/Client
parent4b5d81c77aa37b9d4ce49f19aa4ef71fa482313b (diff)
downloadswift-contrib-23387492f571e8e6c46c6fa6196bf496249c9853.zip
swift-contrib-23387492f571e8e6c46c6fa6196bf496249c9853.tar.bz2
Make connector shared to avoid a crash on login.
Resolves: #346
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/Client.cpp2
-rw-r--r--Swiften/Client/Client.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp
index 9c93a87..63a93a3 100644
--- a/Swiften/Client/Client.cpp
+++ b/Swiften/Client/Client.cpp
@@ -46,7 +46,7 @@ void Client::connect() {
void Client::connect(const String& host) {
assert(!connector_);
- connector_ = boost::shared_ptr<Connector>(new Connector(host, &resolver_, connectionFactory_, timerFactory_));
+ connector_ = Connector::create(host, &resolver_, connectionFactory_, timerFactory_);
connector_->onConnectFinished.connect(boost::bind(&Client::handleConnectorFinished, this, _1));
connector_->setTimeoutMilliseconds(60*1000);
connector_->start();
diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h
index f40f273..92e89f1 100644
--- a/Swiften/Client/Client.h
+++ b/Swiften/Client/Client.h
@@ -10,6 +10,7 @@
#include <boost/shared_ptr.hpp>
#include "Swiften/Network/PlatformDomainNameResolver.h"
+#include "Swiften/Network/Connector.h"
#include "Swiften/Base/Error.h"
#include "Swiften/Client/ClientSession.h"
#include "Swiften/Client/ClientError.h"
@@ -29,7 +30,6 @@ namespace Swift {
class TimerFactory;
class ClientSession;
class BasicSessionStream;
- class Connector;
class Client : public StanzaChannel, public IQRouter, public boost::bsignals::trackable {
public:
@@ -71,7 +71,7 @@ namespace Swift {
JID jid_;
String password_;
IDGenerator idGenerator_;
- boost::shared_ptr<Connector> connector_;
+ Connector::ref connector_;
ConnectionFactory* connectionFactory_;
TimerFactory* timerFactory_;
TLSLayerFactory* tlsLayerFactory_;