summaryrefslogtreecommitdiffstats
path: root/src/Net/Connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Net/Connection.cpp')
-rw-r--r--src/Net/Connection.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Net/Connection.cpp b/src/Net/Connection.cpp
index 22f4570..8eee0cc 100644
--- a/src/Net/Connection.cpp
+++ b/src/Net/Connection.cpp
@@ -38,6 +38,9 @@ Connection::~Connection() {
}
gnutls_certificate_free_credentials(x509_cred);
+
+ if(peer)
+ delete peer;
}
void Connection::handshake() {
@@ -276,13 +279,6 @@ void Connection::doDisconnect() {
gnutls_deinit(session);
- if(peer)
- delete peer;
- peer = 0;
-
- authenticated = false;
- name.clear();
-
state = DISCONNECTED;
}