diff options
| author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2008-12-08 13:01:54 +0100 |
|---|---|---|
| committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2008-12-08 13:05:44 +0100 |
| commit | bf7486c0118c32fe171cca7e50fd3fb89a5dbe72 (patch) | |
| tree | 16bc115472f9a3f41c4eb61a09db870a50bce944 /src/plugins/cpptools/cppcodecompletion.cpp | |
| parent | d0a2f567c1967a17d6c136d3092b2d1a076604fb (diff) | |
| download | qt-creator-bf7486c0118c32fe171cca7e50fd3fb89a5dbe72.tar.gz | |
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.
Diffstat (limited to 'src/plugins/cpptools/cppcodecompletion.cpp')
| -rw-r--r-- | src/plugins/cpptools/cppcodecompletion.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index 47ac5c5767..d24f5a5f81 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -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) |
