From 20c6ad2dfe6db629a6abdfe1313f2ecaf906d16c Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 4 May 2022 12:56:46 +0200 Subject: [PATCH] LanguageClient: track running function hint processor A tracked assist processor gets indirectly deleted in the client destructor and the reset function. This makes sure no processor accesses a deleted or restarted client. Fixes: QTCREATORBUG-27404 Change-Id: Ib264eb4b166f1705bd734299642b93bca0a402c3 Reviewed-by: Reviewed-by: Christian Kandeler --- src/plugins/languageclient/languageclientfunctionhint.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/languageclient/languageclientfunctionhint.cpp b/src/plugins/languageclient/languageclientfunctionhint.cpp index f554d4a3b0e..9c33b632314 100644 --- a/src/plugins/languageclient/languageclientfunctionhint.cpp +++ b/src/plugins/languageclient/languageclientfunctionhint.cpp @@ -95,6 +95,7 @@ IAssistProposal *FunctionHintProcessor::perform(const AssistInterface *interface auto uri = DocumentUri::fromFilePath(interface->filePath()); SignatureHelpRequest request((TextDocumentPositionParams(TextDocumentIdentifier(uri), Position(cursor)))); request.setResponseCallback([this](auto response) { this->handleSignatureResponse(response); }); + m_client->addAssistProcessor(this); m_client->sendContent(request); m_currentRequest = request.id(); return nullptr;