Commit 9e62459d authored by Christoph Cullmann's avatar Christoph Cullmann

avoid crash if handlers trigger LSP actions that invalidate the handler iterator

parent b4379735
...@@ -898,8 +898,11 @@ private: ...@@ -898,8 +898,11 @@ private:
// a valid reply; what to do with it now // a valid reply; what to do with it now
auto it = m_handlers.find(msgid); auto it = m_handlers.find(msgid);
if (it != m_handlers.end()) { if (it != m_handlers.end()) {
// run handler, might e.g. trigger some new LSP actions for this server
(*it)(result.value(MEMBER_RESULT)); (*it)(result.value(MEMBER_RESULT));
// don't use the iterator, might have been invalidated by actions of handler, leads to crashs
} else { } else {
// could have been canceled // could have been canceled
qCDebug(LSPCLIENT) << "unexpected reply id"; qCDebug(LSPCLIENT) << "unexpected reply id";
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