summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--SwifTools/Idle/ActualIdleDetector.cpp8
-rw-r--r--Swift/Controllers/Chat/ChatControllerBase.cpp7
-rw-r--r--Swiften/FileTransfer/IncomingJingleFileTransfer.cpp6
-rw-r--r--Swiften/FileTransfer/OutgoingJingleFileTransfer.cpp7
4 files changed, 22 insertions, 6 deletions
diff --git a/SwifTools/Idle/ActualIdleDetector.cpp b/SwifTools/Idle/ActualIdleDetector.cpp
index ba23b99..2e2f1f1 100644
--- a/SwifTools/Idle/ActualIdleDetector.cpp
+++ b/SwifTools/Idle/ActualIdleDetector.cpp
@@ -1,18 +1,19 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <SwifTools/Idle/ActualIdleDetector.h>
+
#include <boost/bind.hpp>
-#include <iostream>
-#include <SwifTools/Idle/IdleQuerier.h>
#include <Swiften/Network/Timer.h>
#include <Swiften/Network/TimerFactory.h>
+#include <SwifTools/Idle/IdleQuerier.h>
+
namespace Swift {
ActualIdleDetector::ActualIdleDetector(IdleQuerier* querier, TimerFactory* timerFactory, int refreshRateMilliseconds) : querier(querier) {
@@ -22,6 +23,7 @@ ActualIdleDetector::ActualIdleDetector(IdleQuerier* querier, TimerFactory* timer
}
ActualIdleDetector::~ActualIdleDetector() {
+ timer->onTick.disconnect(boost::bind(&ActualIdleDetector::handleTimerTick, this));
timer->stop();
}
diff --git a/Swift/Controllers/Chat/ChatControllerBase.cpp b/Swift/Controllers/Chat/ChatControllerBase.cpp
index f4b715c..4a84a6e 100644
--- a/Swift/Controllers/Chat/ChatControllerBase.cpp
+++ b/Swift/Controllers/Chat/ChatControllerBase.cpp
@@ -54,6 +54,11 @@ ChatControllerBase::ChatControllerBase(const JID& self, StanzaChannel* stanzaCha
}
ChatControllerBase::~ChatControllerBase() {
+ if (dateChangeTimer_) {
+ dateChangeTimer_->onTick.disconnect(boost::bind(&ChatControllerBase::handleDayChangeTick, this));
+ dateChangeTimer_->stop();
+ }
+
delete highlighter_;
delete chatWindow_;
}
@@ -85,7 +90,7 @@ void ChatControllerBase::createDayChangeTimer() {
boost::posix_time::ptime now = boost::posix_time::second_clock::local_time();
boost::posix_time::ptime midnight(now.date() + boost::gregorian::days(1));
int millisecondsUntilMidnight = boost::numeric_cast<int>((midnight - now).total_milliseconds());
- dateChangeTimer_ = boost::shared_ptr<Timer>(timerFactory_->createTimer(millisecondsUntilMidnight));
+ dateChangeTimer_ = timerFactory_->createTimer(millisecondsUntilMidnight);
dateChangeTimer_->onTick.connect(boost::bind(&ChatControllerBase::handleDayChangeTick, this));
dateChangeTimer_->start();
}
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;