summaryrefslogtreecommitdiff
path: root/src/plugins/clangcodemodel/semanticmarker.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-07-20 12:09:32 +0200
committerNikolai Kosjar <nikolai.kosjar@theqtcompany.com>2015-07-20 13:20:01 +0000
commit8938addc5ca6b74e602fcb2496275cb8554376ee (patch)
treeb0f96f221e795cd675474a503257c564221a33a4 /src/plugins/clangcodemodel/semanticmarker.cpp
parent91ee695c713c8235a09bc91df80709fb476e3ee6 (diff)
downloadqt-creator-8938addc5ca6b74e602fcb2496275cb8554376ee.tar.gz
Clang: Remove QTC_ASSERT
If an editor is opened, the semantic highlighter is triggered twice: 1) From ClangEditorDocumentProcessor::onParserFinished 2) From CppEditorDocument::applyFontSettings Caller 1) is expected, it creates an m_unit. However, if threads are scheduled differently, the semantic highlighter triggered from 2) will encounter an invalid m_unit. I'm not sure whether the call to 2) is correct at all. Change-Id: Ia6ff2852e7d38418ebb01edc3eca3680fac1820a Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Diffstat (limited to 'src/plugins/clangcodemodel/semanticmarker.cpp')
-rw-r--r--src/plugins/clangcodemodel/semanticmarker.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/clangcodemodel/semanticmarker.cpp b/src/plugins/clangcodemodel/semanticmarker.cpp
index 71a5abc03d..cb5d0b71f4 100644
--- a/src/plugins/clangcodemodel/semanticmarker.cpp
+++ b/src/plugins/clangcodemodel/semanticmarker.cpp
@@ -333,9 +333,8 @@ QList<SourceMarker> SemanticMarker::sourceMarkersInRange(unsigned firstLine,
unsigned lastLine)
{
QList<SourceMarker> result;
- QTC_ASSERT(m_unit, return result);
- if (!m_unit->isLoaded())
+ if (!m_unit || !m_unit->isLoaded())
return result;
// Highlighting called asynchronously, and a few lines at the end can be deleted for this time.