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/FileTransfer | |
| 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/FileTransfer')
| -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 | |||
| @@ -71,17 +71,25 @@ void LocalJingleTransportCandidateGenerator::start() { | |||
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | void LocalJingleTransportCandidateGenerator::stop() { | 75 | void LocalJingleTransportCandidateGenerator::stop() { |
| 76 | s5bProxy->onDiscoveredProxiesChanged.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleDiscoveredProxiesChanged, this)); | ||
| 77 | if (s5bServerPortForwardingUser_) { | ||
| 78 | s5bServerPortForwardingUser_->onSetup.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handlePortForwardingSetup, this, _1)); | ||
| 79 | s5bServerPortForwardingUser_.reset(); | ||
| 80 | } | ||
| 76 | if (s5bServerResourceUser_) { | 81 | if (s5bServerResourceUser_) { |
| 77 | s5bServerResourceUser_->onSuccessfulInitialized.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleS5BServerInitialized, this, _1)); | 82 | s5bServerResourceUser_->onSuccessfulInitialized.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleS5BServerInitialized, this, _1)); |
| 83 | s5bServerResourceUser_.reset(); | ||
| 78 | } | 84 | } |
| 79 | s5bServerResourceUser_.reset(); | ||
| 80 | } | 85 | } |
| 81 | 86 | ||
| 82 | void LocalJingleTransportCandidateGenerator::handleS5BServerInitialized(bool success) { | 87 | void LocalJingleTransportCandidateGenerator::handleS5BServerInitialized(bool success) { |
| 88 | if (s5bServerResourceUser_) { | ||
| 89 | s5bServerResourceUser_->onSuccessfulInitialized.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleS5BServerInitialized, this, _1)); | ||
| 90 | } | ||
| 83 | triedServerInit_ = true; | 91 | triedServerInit_ = true; |
| 84 | if (success) { | 92 | if (success) { |
| 85 | if (options_.isAssistedAllowed()) { | 93 | if (options_.isAssistedAllowed()) { |
| 86 | // try to setup port forwarding | 94 | // try to setup port forwarding |
| 87 | s5bServerPortForwardingUser_ = s5bServerManager->aquirePortForwardingUser(); | 95 | s5bServerPortForwardingUser_ = s5bServerManager->aquirePortForwardingUser(); |
| @@ -109,11 +117,13 @@ void LocalJingleTransportCandidateGenerator::handlePortForwardingSetup(bool /* s | |||
| 109 | triedForwarding_ = true; | 117 | triedForwarding_ = true; |
| 110 | checkS5BCandidatesReady(); | 118 | checkS5BCandidatesReady(); |
| 111 | } | 119 | } |
| 112 | 120 | ||
| 113 | void LocalJingleTransportCandidateGenerator::handleDiscoveredProxiesChanged() { | 121 | void LocalJingleTransportCandidateGenerator::handleDiscoveredProxiesChanged() { |
| 114 | s5bProxy->onDiscoveredProxiesChanged.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleDiscoveredProxiesChanged, this)); | 122 | if (s5bProxy) { |
| 123 | s5bProxy->onDiscoveredProxiesChanged.disconnect(boost::bind(&LocalJingleTransportCandidateGenerator::handleDiscoveredProxiesChanged, this)); | ||
| 124 | } | ||
| 115 | triedProxyDiscovery_ = true; | 125 | triedProxyDiscovery_ = true; |
| 116 | checkS5BCandidatesReady(); | 126 | checkS5BCandidatesReady(); |
| 117 | } | 127 | } |
| 118 | 128 | ||
| 119 | void LocalJingleTransportCandidateGenerator::checkS5BCandidatesReady() { | 129 | void LocalJingleTransportCandidateGenerator::checkS5BCandidatesReady() { |
Swift