Fix memory leak when error reported
Change-Id: I0c4c0baed8f2a734b3986b0d446cd58df705f7e4 Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
14fcddc336
commit
a9fcfa648a
@ -233,6 +233,7 @@ bool FileManager::generateFiles()
|
||||
errString = tr("Failed to open/create file %1: %2")
|
||||
.arg(file->fileName()).arg(file->errorString());
|
||||
emit error();
|
||||
delete file;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -241,6 +242,7 @@ bool FileManager::generateFiles()
|
||||
if (!file->resize(singleFile.length)) {
|
||||
errString = tr("Failed to resize file %1: %2")
|
||||
.arg(file->fileName()).arg(file->errorString());
|
||||
delete file;
|
||||
emit error();
|
||||
return false;
|
||||
}
|
||||
@ -288,6 +290,7 @@ bool FileManager::generateFiles()
|
||||
errString = tr("Failed to open/create file %1: %2")
|
||||
.arg(file->fileName()).arg(file->errorString());
|
||||
emit error();
|
||||
delete file;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -297,6 +300,7 @@ bool FileManager::generateFiles()
|
||||
errString = tr("Failed to resize file %1: %2")
|
||||
.arg(file->fileName()).arg(file->errorString());
|
||||
emit error();
|
||||
delete file;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user