GUI: If project open failed project got invalid.
The project was deleted but not set as NULL when the project open failed. Fix this by deleting the project only when the opening succeeds.
This commit is contained in:
parent
e81fa46699
commit
9de4ce8c8e
|
@ -724,8 +724,6 @@ void MainWindow::OpenHtmlHelpContents()
|
|||
|
||||
void MainWindow::OpenProjectFile()
|
||||
{
|
||||
delete mProject;
|
||||
|
||||
const QString filter = tr("Project files (*.cppcheck);;All files(*.*)");
|
||||
QString filepath = QFileDialog::getOpenFileName(this,
|
||||
tr("Select Project File"),
|
||||
|
@ -740,6 +738,7 @@ void MainWindow::OpenProjectFile()
|
|||
|
||||
mUI.mActionCloseProjectFile->setEnabled(true);
|
||||
mUI.mActionEditProjectFile->setEnabled(true);
|
||||
delete mProject;
|
||||
mProject = new Project(filepath, this);
|
||||
mProject->Open();
|
||||
QString rootpath = mProject->GetProjectFile()->GetRootPath();
|
||||
|
|
Loading…
Reference in New Issue