forked from qt-creator/qt-creator
CppEditor/CppTools: Avoid triggering garbage collector on editor close in tests
Closing an editor might trigger a timer which leads to the invocation of the garbage collector. This is unfavourable for the plugin tests since a test function closing an editor might influence a subsequent test function (e.g. files get removed from the global snapshot although they were added shortly before). Change-Id: Ia80c11f99e2437fe145dc2d983b21962539b5181 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -846,7 +846,8 @@ void CppModelManager::onProjectAdded(ProjectExplorer::Project *)
|
||||
|
||||
void CppModelManager::delayedGC()
|
||||
{
|
||||
m_delayedGcTimer->start(500);
|
||||
if (m_enableGC)
|
||||
m_delayedGcTimer->start(500);
|
||||
}
|
||||
|
||||
void CppModelManager::onAboutToRemoveProject(ProjectExplorer::Project *project)
|
||||
@@ -992,6 +993,12 @@ CppIndexingSupport *CppModelManager::indexingSupport()
|
||||
return m_indexingSupporter ? m_indexingSupporter : m_internalIndexingSupport;
|
||||
}
|
||||
|
||||
void CppModelManager::enableGarbageCollector(bool enable)
|
||||
{
|
||||
m_delayedGcTimer->stop();
|
||||
m_enableGC = enable;
|
||||
}
|
||||
|
||||
void CppModelManager::setExtraDiagnostics(const QString &fileName,
|
||||
const QString &kind,
|
||||
const QList<Document::DiagnosticMessage> &diagnostics)
|
||||
|
Reference in New Issue
Block a user