From d6ef26b64e763146ab46e44b79acbe1a85d08a07 Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Wed, 24 Feb 2021 21:50:28 +0100 Subject: [PATCH] Delete tmpfile on all failures --- src/convertworker.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/convertworker.cpp b/src/convertworker.cpp index e135da3..7dc67ed 100644 --- a/src/convertworker.cpp +++ b/src/convertworker.cpp @@ -93,6 +93,7 @@ void ConvertWorker::convertPdf(QNetworkRequest request, QString filename, QTempo } else { + tempfile->deleteLater(); emit failed(tr("Unsupported target format")); return; } @@ -344,6 +345,7 @@ void ConvertWorker::convertImage(QNetworkRequest request, QString filename, QTem } else { + tempfile->deleteLater(); emit failed(tr("Unsupported target format")); return; } @@ -373,6 +375,7 @@ void ConvertWorker::convertImage(QNetworkRequest request, QString filename, QTem if(!inImage.load(filename)) { qDebug() << "failed to load"; + tempfile->deleteLater(); emit failed(tr("Failed to load image")); return; }