aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2020-03-30 19:12:06 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2020-03-30 19:12:06 +0200
commitbd14854f1d4790aeea5e39ee6ceabbd690331761 (patch)
treeac3d5aa8f118b21fb2fc845b9230f42bcc7ee1f6
parentf5876b7c9fbaf07696605929e37f9921ce6e745e (diff)
downloadlibquotient-bd14854f1d4790aeea5e39ee6ceabbd690331761.tar.gz
libquotient-bd14854f1d4790aeea5e39ee6ceabbd690331761.zip
BaseJob: shutdown timers on abandoning and destruction
A part of the fix for #398.
-rw-r--r--lib/jobs/basejob.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp
index a1f49b63..30d60f9e 100644
--- a/lib/jobs/basejob.cpp
+++ b/lib/jobs/basejob.cpp
@@ -104,6 +104,7 @@ BaseJob::BaseJob(HttpVerb verb, const QString& name, const QString& endpoint,
BaseJob::~BaseJob()
{
stop();
+ d->retryTimer.stop(); // See #398
qCDebug(d->logCat) << this << "destroyed";
}
@@ -641,6 +642,8 @@ void BaseJob::setStatus(int code, QString message)
void BaseJob::abandon()
{
beforeAbandon(d->reply ? d->reply.data() : nullptr);
+ d->timer.stop();
+ d->retryTimer.stop(); // In case abandon() was called between retries
setStatus(Abandoned);
if (d->reply)
d->reply->disconnect(this);