summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-12-07 18:23:22 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-12-07 18:23:22 (GMT)
commite32059da8bffc67806862bf78f762d67fb3e4848 (patch)
tree529f5481dc8b832090c778874a0255cbc1c73524 /Swiften/Client/Client.cpp
parent2e1bed9790ce11d856006aaa8692fed225cc10d3 (diff)
downloadswift-e32059da8bffc67806862bf78f762d67fb3e4848.zip
swift-e32059da8bffc67806862bf78f762d67fb3e4848.tar.bz2
Fixed segfault on disconnect.
Diffstat (limited to 'Swiften/Client/Client.cpp')
-rw-r--r--Swiften/Client/Client.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp
index e9de19a..27f3d9c 100644
--- a/Swiften/Client/Client.cpp
+++ b/Swiften/Client/Client.cpp
@@ -72,9 +72,10 @@ void Client::handleConnectorFinished(boost::shared_ptr<Connection> connection) {
void Client::disconnect() {
if (session_) {
session_->finish();
- session_.reset();
}
- closeConnection();
+ else {
+ closeConnection();
+ }
}
void Client::closeConnection() {
@@ -136,6 +137,7 @@ void Client::setCertificate(const String& certificate) {
}
void Client::handleSessionFinished(boost::shared_ptr<Error> error) {
+ session_.reset();
closeConnection();
if (error) {
ClientError clientError;
@@ -191,7 +193,6 @@ void Client::handleSessionFinished(boost::shared_ptr<Error> error) {
}
onError(clientError);
}
- session_.reset();
}
void Client::handleNeedCredentials() {