Close files on error

This commit is contained in:
Floris Bos 2020-07-03 21:08:51 +02:00
parent 9a263f0211
commit 19bfc8eacb
3 changed files with 34 additions and 26 deletions

View file

@ -36,6 +36,7 @@ void LocalFileExtractThread::run()
if (!_inputfile.open(_inputfile.ReadOnly))
{
_onDownloadError(tr("Error opening image file"));
_closeFiles();
return;
}
_lastDlTotal = _inputfile.size();
@ -45,6 +46,8 @@ void LocalFileExtractThread::run()
else
extractMultiFileRun();
if (_cancelled)
_closeFiles();
}
ssize_t LocalFileExtractThread::_on_read(struct archive *, const void **buff)