From 61ed2023841456fb9394b19bfea4e9bb2df0d73e Mon Sep 17 00:00:00 2001 From: Jasem Mutlaq Date: Wed, 17 May 2017 19:45:33 +0300 Subject: [PATCH] Delete preview job on abort --- kstars/ekos/capture/capture.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/kstars/ekos/capture/capture.cpp b/kstars/ekos/capture/capture.cpp index d2c904e14..24d0f5cd4 100644 --- a/kstars/ekos/capture/capture.cpp +++ b/kstars/ekos/capture/capture.cpp @@ -464,8 +464,18 @@ void Capture::stop(bool abort) emit newStatus(Ekos::CAPTURE_ABORTED); } - activeJob->disconnect(this); - activeJob->reset(); + if (activeJob->isPreview() == false) + { + activeJob->disconnect(this); + activeJob->reset(); + } + else // Delete preview job + { + jobs.removeOne(activeJob); + delete (activeJob); + activeJob = nullptr; + } + } state = CAPTURE_IDLE; -- GitLab