diff options
Diffstat (limited to 'Swiften/ScreenSharing/OutgoingScreenSharing.cpp')
-rw-r--r-- | Swiften/ScreenSharing/OutgoingScreenSharing.cpp | 8 |
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; |