mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
ZSync: ensure the temporary file is closed after the download
Otherwise renaming it to the final file will fail on windows
This commit is contained in:
parent
00984b6738
commit
11cf37ac33
@ -881,6 +881,7 @@ void PropagateDownloadFile::contentChecksumComputed(const QByteArray &checksumTy
|
||||
|
||||
void PropagateDownloadFile::downloadFinished()
|
||||
{
|
||||
ASSERT(!_tmpFile.isOpen());
|
||||
QString fn = propagator()->getFilePath(_item->_file);
|
||||
|
||||
// In case of file name clash, report an error
|
||||
|
||||
@ -129,6 +129,8 @@ bool GETFileZsyncJob::finished()
|
||||
}
|
||||
|
||||
if (!_hasEmittedFinishedSignal) {
|
||||
_zr.reset();
|
||||
_zs.reset(); // ensure the file is closed.
|
||||
emit finishedSignal();
|
||||
}
|
||||
|
||||
@ -179,6 +181,8 @@ void GETFileZsyncJob::seedFinished(void *zs)
|
||||
if (_nrange == 0 && _item->_size == quint64(zsync_file_length(_zs.get()))) {
|
||||
_propagator->reportFileTotal(*_item, 0);
|
||||
_errorStatus = SyncFileItem::Success;
|
||||
_zr.reset();
|
||||
_zs.reset(); // ensure the file is closed.
|
||||
emit finishedSignal();
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user