mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-28 11:18:05 -06:00
Delete temporary after they aren't needed. Closes #1188.
This commit is contained in:
@@ -134,8 +134,8 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) {
|
||||
}
|
||||
// Success
|
||||
QTemporaryFile *tmpfile = new QTemporaryFile;
|
||||
tmpfile->setAutoRemove(false);
|
||||
if (tmpfile->open()) {
|
||||
tmpfile->setAutoRemove(false);
|
||||
QString filePath = tmpfile->fileName();
|
||||
qDebug("Temporary filename is: %s", qPrintable(filePath));
|
||||
if (reply->isOpen() || reply->open(QIODevice::ReadOnly)) {
|
||||
@@ -153,6 +153,7 @@ void DownloadThread::processDlFinished(QNetworkReply* reply) {
|
||||
emit downloadFinished(url, filePath);
|
||||
} else {
|
||||
delete tmpfile;
|
||||
fsutils::forceRemove(filePath);
|
||||
// Error when reading the request
|
||||
emit downloadFailure(url, tr("I/O Error"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user