Don't keep around references to old documents

The code completion was keeping around references to old documents after
the completion finished. This caused documents to stay in memory when
unloading projects, up until the next time you used the completion.
This commit is contained in:
Thorbjørn Lindeijer
2008-12-08 13:01:54 +01:00
parent d0a2f567c1
commit bf7486c011
3 changed files with 8 additions and 0 deletions

View File

@@ -1027,6 +1027,10 @@ bool CppCodeCompletion::partiallyComplete(const QList<TextEditor::CompletionItem
void CppCodeCompletion::cleanup()
{
m_completions.clear();
// Set empty map in order to avoid referencing old versions of the documents
// until the next completion
typeOfExpression.setDocuments(QMap<QString, Document::Ptr>());
}
int CppCodeCompletion::findStartOfName(const TextEditor::ITextEditor *editor)