Prevent deletion uninitialized pointer.
--HG-- branch : develop
This commit is contained in:
parent
fbe84b74f4
commit
47a61dcbc7
|
@ -102,7 +102,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
||||||
ui->toolBoxMeasurements->setItemEnabled(0, false);
|
ui->toolBoxMeasurements->setItemEnabled(0, false);
|
||||||
|
|
||||||
const QString filePath = doc->MPath();
|
const QString filePath = doc->MPath();
|
||||||
VStandardMeasurements *mSt;
|
VStandardMeasurements *mSt = nullptr;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", filePath);
|
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", filePath);
|
||||||
|
@ -117,7 +117,10 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
||||||
catch (VException &e)
|
catch (VException &e)
|
||||||
{
|
{
|
||||||
e.CriticalMessageBox(tr("File error."), this);
|
e.CriticalMessageBox(tr("File error."), this);
|
||||||
|
if (mSt != nullptr)
|
||||||
|
{
|
||||||
delete mSt;
|
delete mSt;
|
||||||
|
}
|
||||||
emit DialogClosed(QDialog::Rejected);
|
emit DialogClosed(QDialog::Rejected);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user