Commit d7e5d414 authored by David Schulz's avatar David Schulz

Editor: Fix crash in generic highlighter.

Make sure that the progress data object is deleted before the rule.

Task-number: QTCREATORBUG-13883
Change-Id: Ie0d1825e695f0bfa7d46ee6dd807a94c95a08cd7
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent 26972ade
...@@ -164,16 +164,17 @@ void Highlighter::highlightBlock(const QString &text) ...@@ -164,16 +164,17 @@ void Highlighter::highlightBlock(const QString &text)
handleContextChange(m_currentContext->lineBeginContext(), handleContextChange(m_currentContext->lineBeginContext(),
m_currentContext->definition()); m_currentContext->definition());
ProgressData progress; ProgressData *progress = new ProgressData;
const int length = text.length(); const int length = text.length();
while (progress.offset() < length) while (progress->offset() < length)
iterateThroughRules(text, length, &progress, false, m_currentContext->rules()); iterateThroughRules(text, length, progress, false, m_currentContext->rules());
if (extractObservableState(currentBlockState()) != WillContinue) { if (extractObservableState(currentBlockState()) != WillContinue) {
handleContextChange(m_currentContext->lineEndContext(), handleContextChange(m_currentContext->lineEndContext(),
m_currentContext->definition(), m_currentContext->definition(),
false); false);
} }
delete progress;
m_contexts.clear(); m_contexts.clear();
if (m_indentationBasedFolding) { if (m_indentationBasedFolding) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment