forked from qt-creator/qt-creator
QmlJs: check markers before cleaning them
Task-number: QTCREATORBUG-20197 Change-Id: If4594a72abf4acf2455e55688679ba7f78900f76 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -597,6 +597,10 @@ void QmlJSEditorDocumentPrivate::updateOutlineModel()
|
||||
|
||||
static void cleanMarks(QVector<TextEditor::TextMark *> *marks, TextEditor::TextDocument *doc)
|
||||
{
|
||||
// if doc is null, this method is improperly called, so better do nothing that leave an
|
||||
// inconsistent state where marks are cleared but not removed from doc.
|
||||
if (!marks || !doc)
|
||||
return;
|
||||
for (TextEditor::TextMark *mark : *marks) {
|
||||
doc->removeMark(mark);
|
||||
delete mark;
|
||||
|
Reference in New Issue
Block a user