diff options
author | Tobias Markmann <tm@ayena.de> | 2015-06-25 21:42:45 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-07-10 11:51:12 (GMT) |
commit | b9535a45e856213050ec1e73539a68ebcc0f801e (patch) | |
tree | 88e9cf7444114eed13a6f33c6c697f0e528a6909 /Swiften | |
parent | ed7a1fbf61d7879fd33896f36effd2f154753438 (diff) | |
download | swift-b9535a45e856213050ec1e73539a68ebcc0f801e.zip swift-b9535a45e856213050ec1e73539a68ebcc0f801e.tar.bz2 |
Explicitly disconnect early from signals in candidate generator
This is an attempt to fix crash reports with a segmentation fault on
call of onLocalTransportCandidatesGenerated().
Test-Information:
Tested that file-transfer still works.
Change-Id: I415be0d8bc5fa15dcd68d0794ee2478a0d836f27
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp index 6ef0e6a..fd0e571 100644 --- a/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp +++ b/Swiften/FileTransfer/LocalJingleTransportCandidateGenerator.cpp @@ -73,13 +73,21 @@ void LocalJingleTransportCandidateGenerator::start() { } void LocalJingleTransportCandidateGenerator::stop() { + s5bProxy->onDiscoveredProxiesChanged.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleDiscoveredProxiesChanged, this)); + if (s5bServerPortForwardingUser_) { + s5bServerPortForwardingUser_->onSetup.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handlePortForwardingSetup, this, _1)); + s5bServerPortForwardingUser_.reset(); + } if (s5bServerResourceUser_) { s5bServerResourceUser_->onSuccessfulInitialized.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleS5BServerInitialized, this, _1)); + s5bServerResourceUser_.reset(); } - s5bServerResourceUser_.reset(); } void LocalJingleTransportCandidateGenerator::handleS5BServerInitialized(bool success) { + if (s5bServerResourceUser_) { + s5bServerResourceUser_->onSuccessfulInitialized.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleS5BServerInitialized, this, _1)); + } triedServerInit_ = true; if (success) { if (options_.isAssistedAllowed()) { @@ -111,7 +119,9 @@ void LocalJingleTransportCandidateGenerator::handlePortForwardingSetup(bool /* s } void LocalJingleTransportCandidateGenerator::handleDiscoveredProxiesChanged() { - s5bProxy->onDiscoveredProxiesChanged.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleDiscoveredProxiesChanged, this)); + if (s5bProxy) { + s5bProxy->onDiscoveredProxiesChanged.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleDiscoveredProxiesChanged, this)); + } triedProxyDiscovery_ = true; checkS5BCandidatesReady(); } |