forked from qt-creator/qt-creator
SessionManager::projects() return a copy instead of a const&
Fixes a crash on session restore for Eike. Iterating over a const & of the list is dangerous while projects are added to the list. Change-Id: I1861b7f1875420769c2493fb0b4012728380efd2 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -433,7 +433,7 @@ void SessionManager::closeAllProjects()
|
|||||||
removeProjects(projects());
|
removeProjects(projects());
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<Project *> &SessionManager::projects()
|
QList<Project *> SessionManager::projects()
|
||||||
{
|
{
|
||||||
return d->m_projects;
|
return d->m_projects;
|
||||||
}
|
}
|
||||||
|
@@ -101,7 +101,7 @@ public:
|
|||||||
static Utils::FileName sessionNameToFileName(const QString &session);
|
static Utils::FileName sessionNameToFileName(const QString &session);
|
||||||
static Project *startupProject();
|
static Project *startupProject();
|
||||||
|
|
||||||
static const QList<Project *> &projects();
|
static QList<Project *> projects();
|
||||||
static bool hasProjects();
|
static bool hasProjects();
|
||||||
|
|
||||||
static bool isDefaultVirgin();
|
static bool isDefaultVirgin();
|
||||||
|
Reference in New Issue
Block a user