From bac178f488299ec37ebe86aa91053cf1133d1c12 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 23 Mar 2018 10:43:39 +0900 Subject: BaseJob::start(): self-destruct if not succesfully started Closes #193. --- jobs/basejob.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'jobs') diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index 981b75b1..eb250723 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -235,8 +235,12 @@ void BaseJob::start(const ConnectionData* connData) { d->connection = connData; beforeStart(connData); - sendRequest(); - afterStart(connData, d->reply.data()); + if (status().good()) + sendRequest(); + if (status().good()) + afterStart(connData, d->reply.data()); + if (!status().good()) + QTimer::singleShot(0, this, &BaseJob::finishJob); } void BaseJob::sendRequest() -- cgit v1.2.3