diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index b8aa15e0f8..6356e24da3 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -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 diff --git a/src/libsync/propagatedownloadzsync.cpp b/src/libsync/propagatedownloadzsync.cpp index 1bece1bae4..ae80b53c5c 100644 --- a/src/libsync/propagatedownloadzsync.cpp +++ b/src/libsync/propagatedownloadzsync.cpp @@ -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; }