Debugger: Don't use document with AST from indexing snapshot

...since the AST will be released at some point from another thread.

Change-Id: I71d20228ebec71e98dca3474452677ec63ffe4c6
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-08-29 11:47:48 +02:00
committed by Erik Verbruggen
parent 82325d1046
commit d4e49c088a

View File

@@ -2828,10 +2828,7 @@ static CPlusPlus::Document::Ptr getParsedDocument(const QString &fileName,
unsigned BreakpointCorrectionContext::fixLineNumber(const QString &fileName,
unsigned lineNumber) const
{
CPlusPlus::Document::Ptr doc = m_snapshot.document(fileName);
if (!doc || !doc->translationUnit()->ast())
doc = getParsedDocument(fileName, m_workingCopy, m_snapshot);
const CPlusPlus::Document::Ptr doc = getParsedDocument(fileName, m_workingCopy, m_snapshot);
CPlusPlus::FindCdbBreakpoint findVisitor(doc->translationUnit());
const unsigned correctedLine = findVisitor(lineNumber);
if (!correctedLine) {