mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 16:08:23 +08:00
Removed checks for NULL before calling delete or free
This commit is contained in:
parent
80a2d57f62
commit
ba0779b415
@ -130,16 +130,13 @@ void UEFITool::init()
|
|||||||
ui->actionMessagesCopyAll->setDisabled(true);
|
ui->actionMessagesCopyAll->setDisabled(true);
|
||||||
|
|
||||||
// Create new model ...
|
// Create new model ...
|
||||||
if (model)
|
|
||||||
delete model;
|
delete model;
|
||||||
model = new TreeModel();
|
model = new TreeModel();
|
||||||
ui->structureTreeView->setModel(model);
|
ui->structureTreeView->setModel(model);
|
||||||
// ... and ffsParser
|
// ... and ffsParser
|
||||||
if (ffsParser)
|
|
||||||
delete ffsParser;
|
delete ffsParser;
|
||||||
ffsParser = new FfsParser(model);
|
ffsParser = new FfsParser(model);
|
||||||
// ... and fitParser
|
// ... and fitParser
|
||||||
if (fitParser)
|
|
||||||
delete fitParser;
|
delete fitParser;
|
||||||
fitParser = new FitParser(model);
|
fitParser = new FitParser(model);
|
||||||
|
|
||||||
@ -678,7 +675,6 @@ void UEFITool::saveImageFile()
|
|||||||
|
|
||||||
QByteArray reconstructed;
|
QByteArray reconstructed;
|
||||||
// Create ffsBuilder
|
// Create ffsBuilder
|
||||||
if (!ffsBuilder)
|
|
||||||
delete ffsBuilder;
|
delete ffsBuilder;
|
||||||
ffsBuilder = new FfsBuilder(model);
|
ffsBuilder = new FfsBuilder(model);
|
||||||
STATUS result = ffsBuilder->build(model->index(0,0), reconstructed);
|
STATUS result = ffsBuilder->build(model->index(0,0), reconstructed);
|
||||||
@ -759,12 +755,10 @@ void UEFITool::openImageFile(QString path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Enable search ...
|
// Enable search ...
|
||||||
if (ffsFinder)
|
|
||||||
delete ffsFinder;
|
delete ffsFinder;
|
||||||
ffsFinder = new FfsFinder(model);
|
ffsFinder = new FfsFinder(model);
|
||||||
ui->actionSearch->setEnabled(true);
|
ui->actionSearch->setEnabled(true);
|
||||||
// ... and other operations
|
// ... and other operations
|
||||||
if (ffsOps)
|
|
||||||
delete ffsOps;
|
delete ffsOps;
|
||||||
ffsOps = new FfsOperations(model);
|
ffsOps = new FfsOperations(model);
|
||||||
|
|
||||||
|
@ -3943,7 +3943,7 @@ STATUS FfsParser::parseVssStoreBody(const QModelIndex & index)
|
|||||||
|
|
||||||
QString info;
|
QString info;
|
||||||
|
|
||||||
// Rename deleted variables
|
// Rename invalid variables
|
||||||
if (isInvalid) {
|
if (isInvalid) {
|
||||||
name = QObject::tr("Invalid");
|
name = QObject::tr("Invalid");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user