Removed checks for NULL before calling delete or free

This commit is contained in:
Nikolaj Schlej 2016-04-09 13:18:10 +02:00
parent 80a2d57f62
commit ba0779b415
2 changed files with 8 additions and 14 deletions

View File

@ -130,16 +130,13 @@ void UEFITool::init()
ui->actionMessagesCopyAll->setDisabled(true);
// Create new model ...
if (model)
delete model;
model = new TreeModel();
ui->structureTreeView->setModel(model);
// ... and ffsParser
if (ffsParser)
delete ffsParser;
ffsParser = new FfsParser(model);
// ... and fitParser
if (fitParser)
delete fitParser;
fitParser = new FitParser(model);
@ -678,7 +675,6 @@ void UEFITool::saveImageFile()
QByteArray reconstructed;
// Create ffsBuilder
if (!ffsBuilder)
delete ffsBuilder;
ffsBuilder = new FfsBuilder(model);
STATUS result = ffsBuilder->build(model->index(0,0), reconstructed);
@ -759,12 +755,10 @@ void UEFITool::openImageFile(QString path)
}
// Enable search ...
if (ffsFinder)
delete ffsFinder;
ffsFinder = new FfsFinder(model);
ui->actionSearch->setEnabled(true);
// ... and other operations
if (ffsOps)
delete ffsOps;
ffsOps = new FfsOperations(model);

View File

@ -3943,7 +3943,7 @@ STATUS FfsParser::parseVssStoreBody(const QModelIndex & index)
QString info;
// Rename deleted variables
// Rename invalid variables
if (isInvalid) {
name = QObject::tr("Invalid");
}