Commit e967049f authored by Tobias Hunger's avatar Tobias Hunger Committed by Friedemann Kleint
Browse files

ProjectWizard: Prevent crash on changes to VCS settings



The ProjectExtension kept a pointer to a page which is destroyed
once the wizard is done and accessed it whenever VCS settings
were touched.

Task-number: QTCREATORBUG-9412
Change-Id: Iabe33d877a3d614ab7470c5e11fe26f7de1bb69c
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent 465654b8
......@@ -177,7 +177,7 @@ struct ProjectWizardContext
QList<Core::IVersionControl*> versionControls;
QList<Core::IVersionControl*> activeVersionControls;
QList<ProjectEntry> projects;
ProjectWizardPage *page;
QPointer<ProjectWizardPage> page; // this is managed by the wizard!
bool repositoryExists; // Is VCS 'add' sufficient, or should a repository be created?
QString commonDirectory;
const Core::IWizard *wizard;
......@@ -195,7 +195,7 @@ void ProjectWizardContext::clear()
activeVersionControls.clear();
projects.clear();
commonDirectory.clear();
page = 0;
page.clear();
repositoryExists = false;
wizard = 0;
}
......@@ -329,6 +329,9 @@ void ProjectFileWizardExtension::firstExtensionPageShown(
void ProjectFileWizardExtension::initializeVersionControlChoices()
{
if (m_context->page.isNull())
return;
// Figure out version control situation:
// 1) Directory is managed and VCS supports "Add" -> List it
// 2) Directory is managed and VCS does not support "Add" -> None available
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment