Commit 14b6e7b5 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Try prevent a crash

parent 06a41628
...@@ -2281,7 +2281,11 @@ public: ...@@ -2281,7 +2281,11 @@ public:
this, this,
SLOT(clearSemanticTokensHighlighting(KTextEditor::Document *)), SLOT(clearSemanticTokensHighlighting(KTextEditor::Document *)),
Qt::UniqueConnection); Qt::UniqueConnection);
connect(doc,
SIGNAL(aboutToClose(KTextEditor::Document *)),
this,
SLOT(clearSemanticTokensHighlighting(KTextEditor::Document *)),
Qt::UniqueConnection);
doSemanticHighlighting(activeView); doSemanticHighlighting(activeView);
} }
} }
......
...@@ -17,7 +17,9 @@ void SemanticHighlighter::remove(const QUrl &url) ...@@ -17,7 +17,9 @@ void SemanticHighlighter::remove(const QUrl &url)
auto &movingRanges = it->movingRanges; auto &movingRanges = it->movingRanges;
for (auto mr : movingRanges) { for (auto mr : movingRanges) {
delete mr; delete mr;
mr = nullptr;
} }
movingRanges.clear();
m_docSemanticInfo.remove(url); m_docSemanticInfo.remove(url);
} }
......
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