From 32d85816729fd6275c8422d8ad26e9e185cc7925 Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Wed, 7 Mar 2018 19:46:23 +0300 Subject: [PATCH] memory leak fixed --- limereport/scripteditor/lrscripthighlighter.cpp | 7 +++++++ limereport/scripteditor/lrscripthighlighter.h | 1 + 2 files changed, 8 insertions(+) diff --git a/limereport/scripteditor/lrscripthighlighter.cpp b/limereport/scripteditor/lrscripthighlighter.cpp index 1dac14b..d6efa5b 100644 --- a/limereport/scripteditor/lrscripthighlighter.cpp +++ b/limereport/scripteditor/lrscripthighlighter.cpp @@ -205,6 +205,13 @@ ScriptHighlighter::ScriptHighlighter(QTextDocument* parent): } } +TextBlockData::~TextBlockData() +{ + foreach(ParenthesisInfo* info, m_parentheses){ + delete info; + } +} + QVector TextBlockData::parentheses() { return m_parentheses; diff --git a/limereport/scripteditor/lrscripthighlighter.h b/limereport/scripteditor/lrscripthighlighter.h index 4580484..136b053 100644 --- a/limereport/scripteditor/lrscripthighlighter.h +++ b/limereport/scripteditor/lrscripthighlighter.h @@ -23,6 +23,7 @@ class TextBlockData : public QTextBlockUserData { public: TextBlockData(){} + ~TextBlockData(); QVector parentheses(); void insert(ParenthesisInfo *info);