summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@theqtcompany.com>2015-02-02 15:00:19 +0100
committerDavid Schulz <david.schulz@theqtcompany.com>2015-02-02 14:46:19 +0000
commitd7e5d41494597ceaf7422f4b6a918d024c31caad (patch)
treebab426e4927a24751bb4648ea7e9161d6e42f798
parent26972ade65a1b256da707b87138ae1a2d67901b5 (diff)
downloadqt-creator-d7e5d41494597ceaf7422f4b6a918d024c31caad.tar.gz
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: Eike Ziller <eike.ziller@theqtcompany.com>
-rw-r--r--src/plugins/texteditor/generichighlighter/highlighter.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/texteditor/generichighlighter/highlighter.cpp b/src/plugins/texteditor/generichighlighter/highlighter.cpp
index ca46a2d3d8..ed5ca09509 100644
--- a/src/plugins/texteditor/generichighlighter/highlighter.cpp
+++ b/src/plugins/texteditor/generichighlighter/highlighter.cpp
@@ -164,16 +164,17 @@ void Highlighter::highlightBlock(const QString &text)
handleContextChange(m_currentContext->lineBeginContext(),
m_currentContext->definition());
- ProgressData progress;
+ ProgressData *progress = new ProgressData;
const int length = text.length();
- while (progress.offset() < length)
- iterateThroughRules(text, length, &progress, false, m_currentContext->rules());
+ while (progress->offset() < length)
+ iterateThroughRules(text, length, progress, false, m_currentContext->rules());
if (extractObservableState(currentBlockState()) != WillContinue) {
handleContextChange(m_currentContext->lineEndContext(),
m_currentContext->definition(),
false);
}
+ delete progress;
m_contexts.clear();
if (m_indentationBasedFolding) {