summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordknn <yoann.blein@free.fr>2012-07-15 13:45:23 (GMT)
committerdknn <yoann.blein@free.fr>2012-09-22 09:01:49 (GMT)
commit70e395802de55b1d2eb9f92ad86349cd2d0d0575 (patch)
tree8759cc27b5d8e0a9984bab0beb6802fab769ae8a /Swiften/ScreenSharing/OutgoingScreenSharing.cpp
parentdd1c425caa5badf2d0b53271b7734f5be57d4003 (diff)
downloadswift-contrib-70e395802de55b1d2eb9f92ad86349cd2d0d0575.zip
swift-contrib-70e395802de55b1d2eb9f92ad86349cd2d0d0575.tar.bz2
Add signal disconnects
Diffstat (limited to 'Swiften/ScreenSharing/OutgoingScreenSharing.cpp')
-rw-r--r--Swiften/ScreenSharing/OutgoingScreenSharing.cpp8
1 files changed, 6 insertions, 2 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;