Commit 321e1c26 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Try to fix of a rare crash with Ctrl + Click in LSP



With Ctrl + Click kate sometimes crashes. I have been trying to reproduce
this issue but have been unlucky so far. The problem seems to be a stale
widget to me, so this will hopefully take care of the issue.
Signed-off-by: Waqar Ahmed's avatarWaqar Ahmed <waqar.17a@gmail.com>
parent ff4d1ff4
...@@ -258,6 +258,7 @@ public: ...@@ -258,6 +258,7 @@ public:
} }
} }
} }
w.clear();
} }
void setRangeAndWidget(const KTextEditor::Range &r, QWidget *wid) void setRangeAndWidget(const KTextEditor::Range &r, QWidget *wid)
...@@ -268,7 +269,7 @@ public: ...@@ -268,7 +269,7 @@ public:
bool isValid() const bool isValid() const
{ {
return w != nullptr; return !w.isNull();
} }
private: private:
...@@ -284,7 +285,7 @@ private: ...@@ -284,7 +285,7 @@ private:
} }
private: private:
QWidget *w = nullptr; QPointer<QWidget> w;
QHash<KTextEditor::Document *, KTextEditor::MovingRange *> ranges; QHash<KTextEditor::Document *, KTextEditor::MovingRange *> ranges;
KTextEditor::Range range; KTextEditor::Range range;
}; };
......
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