Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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