summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/ClientSessionStanzaChannel.cpp15
-rw-r--r--Swiften/Client/ClientSessionStanzaChannel.h4
2 files changed, 16 insertions, 3 deletions
diff --git a/Swiften/Client/ClientSessionStanzaChannel.cpp b/Swiften/Client/ClientSessionStanzaChannel.cpp
index 3d7b9f7..3dc8c59 100644
--- a/Swiften/Client/ClientSessionStanzaChannel.cpp
+++ b/Swiften/Client/ClientSessionStanzaChannel.cpp
@@ -1,16 +1,27 @@
1/* 1/*
2 * Copyright (c) 2010 Isode Limited. 2 * Copyright (c) 2010-2015 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
6 6
7#include <Swiften/Client/ClientSessionStanzaChannel.h> 7#include <Swiften/Client/ClientSessionStanzaChannel.h>
8 8
9#include <boost/bind.hpp>
10#include <iostream> 9#include <iostream>
11 10
11#include <boost/bind.hpp>
12
12namespace Swift { 13namespace Swift {
13 14
15ClientSessionStanzaChannel::~ClientSessionStanzaChannel() {
16 if (session) {
17 session->onFinished.disconnect(boost::bind(&ClientSessionStanzaChannel::handleSessionFinished, this, _1));
18 session->onStanzaReceived.disconnect(boost::bind(&ClientSessionStanzaChannel::handleStanza, this, _1));
19 session->onStanzaAcked.disconnect(boost::bind(&ClientSessionStanzaChannel::handleStanzaAcked, this, _1));
20 session->onInitialized.disconnect(boost::bind(&ClientSessionStanzaChannel::handleSessionInitialized, this));
21 session.reset();
22 }
23}
24
14void ClientSessionStanzaChannel::setSession(boost::shared_ptr<ClientSession> session) { 25void ClientSessionStanzaChannel::setSession(boost::shared_ptr<ClientSession> session) {
15 assert(!this->session); 26 assert(!this->session);
16 this->session = session; 27 this->session = session;
diff --git a/Swiften/Client/ClientSessionStanzaChannel.h b/Swiften/Client/ClientSessionStanzaChannel.h
index 1104416..0ffcd9d 100644
--- a/Swiften/Client/ClientSessionStanzaChannel.h
+++ b/Swiften/Client/ClientSessionStanzaChannel.h
@@ -12,8 +12,8 @@
12#include <Swiften/Base/IDGenerator.h> 12#include <Swiften/Base/IDGenerator.h>
13#include <Swiften/Client/ClientSession.h> 13#include <Swiften/Client/ClientSession.h>
14#include <Swiften/Client/StanzaChannel.h> 14#include <Swiften/Client/StanzaChannel.h>
15#include <Swiften/Elements/Message.h>
16#include <Swiften/Elements/IQ.h> 15#include <Swiften/Elements/IQ.h>
16#include <Swiften/Elements/Message.h>
17#include <Swiften/Elements/Presence.h> 17#include <Swiften/Elements/Presence.h>
18 18
19namespace Swift { 19namespace Swift {
@@ -22,6 +22,8 @@ namespace Swift {
22 */ 22 */
23 class SWIFTEN_API ClientSessionStanzaChannel : public StanzaChannel { 23 class SWIFTEN_API ClientSessionStanzaChannel : public StanzaChannel {
24 public: 24 public:
25 virtual ~ClientSessionStanzaChannel();
26
25 void setSession(boost::shared_ptr<ClientSession> session); 27 void setSession(boost::shared_ptr<ClientSession> session);
26 28
27 void sendIQ(boost::shared_ptr<IQ> iq); 29 void sendIQ(boost::shared_ptr<IQ> iq);