diff options
author | dknn <yoann.blein@free.fr> | 2012-07-15 13:45:23 (GMT) |
---|---|---|
committer | dknn <yoann.blein@free.fr> | 2012-09-22 09:01:49 (GMT) |
commit | 70e395802de55b1d2eb9f92ad86349cd2d0d0575 (patch) | |
tree | 8759cc27b5d8e0a9984bab0beb6802fab769ae8a /Swiften/ScreenSharing | |
parent | dd1c425caa5badf2d0b53271b7734f5be57d4003 (diff) | |
download | swift-contrib-70e395802de55b1d2eb9f92ad86349cd2d0d0575.zip swift-contrib-70e395802de55b1d2eb9f92ad86349cd2d0d0575.tar.bz2 |
Add signal disconnects
Diffstat (limited to 'Swiften/ScreenSharing')
-rw-r--r-- | Swiften/ScreenSharing/OutgoingScreenSharing.cpp | 8 | ||||
-rw-r--r-- | Swiften/ScreenSharing/RTPSession.cpp | 15 | ||||
-rw-r--r-- | Swiften/ScreenSharing/ScreenSharing.cpp | 3 |
3 files changed, 8 insertions, 18 deletions
diff --git a/Swiften/ScreenSharing/OutgoingScreenSharing.cpp b/Swiften/ScreenSharing/OutgoingScreenSharing.cpp index 77226c5..ec0a39c 100644 --- a/Swiften/ScreenSharing/OutgoingScreenSharing.cpp +++ b/Swiften/ScreenSharing/OutgoingScreenSharing.cpp @@ -28,11 +28,12 @@ OutgoingScreenSharing::OutgoingScreenSharing(boost::shared_ptr<JingleSession> se timerFactory(timerFactory), contentID(JingleContentID(idGenerator.generateID(), JingleContentPayload::InitiatorCreator)), canceled(false), sessionAccepted(false), socketConnected(false), encoder(0), packetizer(0) { - session->onSessionAcceptReceived.connect(boost::bind(&OutgoingScreenSharing::handleSessionAcceptReceived, this, _1, _2, _3)); + jingleSession->onSessionAcceptReceived.connect(boost::bind(&OutgoingScreenSharing::handleSessionAcceptReceived, this, _1, _2, _3)); } OutgoingScreenSharing::~OutgoingScreenSharing() { + jingleSession->onSessionAcceptReceived.disconnect(boost::bind(&OutgoingScreenSharing::handleSessionAcceptReceived, this, _1, _2, _3)); delete rtpSession; delete encoder; delete packetizer; @@ -64,7 +65,6 @@ void OutgoingScreenSharing::start(unsigned int width, unsigned int height) jingleSession->sendInitiate(contentID, desc, transport); onStateChange(ScreenSharing::WaitingForAccept); - serverSocket->onConnected.connect(boost::bind(&OutgoingScreenSharing::handleSocketConnected, this)); serverSocket->connectToFirstIncoming(); } @@ -79,6 +79,8 @@ void OutgoingScreenSharing::handleSocketConnected() return; SWIFT_LOG(debug) << "Screen sharing: UDP socket connected" << std::endl; + serverSocket->onConnected.disconnect(boost::bind(&OutgoingScreenSharing::handleSocketConnected, this)); + socketConnected = true; if (sessionAccepted) startRTPSession(); @@ -107,6 +109,8 @@ void OutgoingScreenSharing::handleConnectionFailed() { SWIFT_LOG(debug) << "Screen sharing: unable to connect" << std::endl; + connectionTimer->onTick.disconnect(boost::bind(&OutgoingScreenSharing::handleConnectionFailed, this)); + jingleSession->sendTerminate(JinglePayload::Reason::ConnectivityError); canceled = true; diff --git a/Swiften/ScreenSharing/RTPSession.cpp b/Swiften/ScreenSharing/RTPSession.cpp deleted file mode 100644 index 3a22326..0000000 --- a/Swiften/ScreenSharing/RTPSession.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2012 Yoann Blein - * Licensed under the simplified BSD license. - * See Documentation/Licenses/BSD-simplified.txt for more information. - */ - -#include <Swiften/ScreenSharing/RTPSession.h> - -namespace Swift { - -RTPSession::~RTPSession() -{ -} - -} diff --git a/Swiften/ScreenSharing/ScreenSharing.cpp b/Swiften/ScreenSharing/ScreenSharing.cpp index eede971..be3c8ab 100644 --- a/Swiften/ScreenSharing/ScreenSharing.cpp +++ b/Swiften/ScreenSharing/ScreenSharing.cpp @@ -21,11 +21,12 @@ namespace Swift { ScreenSharing::ScreenSharing(boost::shared_ptr<JingleSession> session, UDPSocketFactory* udpSocketFactory) : rtpSession(0), jingleSession(session), udpSocketFactory(udpSocketFactory) { - session->onSessionTerminateReceived.connect(boost::bind(&ScreenSharing::handleSessionTerminateReceived, this, _1)); + jingleSession->onSessionTerminateReceived.connect(boost::bind(&ScreenSharing::handleSessionTerminateReceived, this, _1)); } ScreenSharing::~ScreenSharing() { + jingleSession->onSessionTerminateReceived.disconnect(boost::bind(&ScreenSharing::handleSessionTerminateReceived, this, _1)); } void ScreenSharing::stop() |