summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-01-22 12:24:02 (GMT)
committerTobias Markmann <tm@ayena.de>2016-01-22 12:24:02 (GMT)
commit52e685379436794cc0e4c2687c35f5e69a2f09a7 (patch)
tree8306420ffd1c9cd221545fb1382b13fc0496c6be /Swiften/FileTransfer
parent8480bdda831e4d18c1979f40badb1bc985e78865 (diff)
downloadswift-52e685379436794cc0e4c2687c35f5e69a2f09a7.zip
swift-52e685379436794cc0e4c2687c35f5e69a2f09a7.tar.bz2
Add missing Timer related cleanup code
This commit adds explicit code to stop timers which are connected to objects that are about to be deleted from memory. Test-Information: ./scons test=system passes on OS X 10.11.3. Change-Id: I139314f3a223e3dc63b78b96be17d3ae53cd3de3
Diffstat (limited to 'Swiften/FileTransfer')
-rw-r--r--Swiften/FileTransfer/IncomingJingleFileTransfer.cpp6
-rw-r--r--Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp7
2 files changed, 11 insertions, 2 deletions
diff --git a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
index 01bed78..8cb1cab 100644
--- a/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
+++ b/Swiften/FileTransfer/IncomingJingleFileTransfer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 Isode Limited.
+ * Copyright (c) 2011-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -56,6 +56,10 @@ IncomingJingleFileTransfer::IncomingJingleFileTransfer(
}
IncomingJingleFileTransfer::~IncomingJingleFileTransfer() {
+ if (waitOnHashTimer) {
+ waitOnHashTimer->stop();
+ }
+
delete hashCalculator;
hashCalculator = NULL;
}
diff --git a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
index b8e848c..a72d5ef 100644
--- a/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
+++ b/Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2013-2015 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -74,6 +74,11 @@ OutgoingJingleFileTransfer::OutgoingJingleFileTransfer(
}
OutgoingJingleFileTransfer::~OutgoingJingleFileTransfer() {
+ if (waitForRemoteTermination) {
+ waitForRemoteTermination->onTick.disconnect(boost::bind(&OutgoingJingleFileTransfer::handleWaitForRemoteTerminationTimeout, this));
+ waitForRemoteTermination->stop();
+ }
+
stream->onRead.disconnect(
boost::bind(&IncrementalBytestreamHashCalculator::feedData, hashCalculator, _1));
delete hashCalculator;