summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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() {