mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-14 02:27:09 -07:00
- Close the file before emitting the signal so that the file can safely be processed in the slot
This commit is contained in:
parent
e4be70edec
commit
9b4cfa4a3d
1 changed files with 2 additions and 1 deletions
|
@ -62,13 +62,14 @@ void downloadThread::processDlFinished(QNetworkReply* reply) {
|
||||||
if(reply->open(QIODevice::ReadOnly)) {
|
if(reply->open(QIODevice::ReadOnly)) {
|
||||||
tmpfile.write(reply->readAll());
|
tmpfile.write(reply->readAll());
|
||||||
reply->close();
|
reply->close();
|
||||||
|
tmpfile.close();
|
||||||
// Send finished signal
|
// Send finished signal
|
||||||
emit downloadFinished(url, filePath);
|
emit downloadFinished(url, filePath);
|
||||||
} else {
|
} else {
|
||||||
// Error when reading the request
|
// Error when reading the request
|
||||||
|
tmpfile.close();
|
||||||
emit downloadFailure(url, tr("I/O Error"));
|
emit downloadFailure(url, tr("I/O Error"));
|
||||||
}
|
}
|
||||||
tmpfile.close();
|
|
||||||
} else {
|
} else {
|
||||||
emit downloadFailure(url, tr("I/O Error"));
|
emit downloadFailure(url, tr("I/O Error"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue