forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -333,9 +333,8 @@ QList<SourceMarker> SemanticMarker::sourceMarkersInRange(unsigned firstLine,
|
|||||||
unsigned lastLine)
|
unsigned lastLine)
|
||||||
{
|
{
|
||||||
QList<SourceMarker> result;
|
QList<SourceMarker> result;
|
||||||
QTC_ASSERT(m_unit, return result);
|
|
||||||
|
|
||||||
if (!m_unit->isLoaded())
|
if (!m_unit || !m_unit->isLoaded())
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
// Highlighting called asynchronously, and a few lines at the end can be deleted for this time.
|
// Highlighting called asynchronously, and a few lines at the end can be deleted for this time.
|
||||||
|
|||||||
Reference in New Issue
Block a user