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: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2022-05-04 12:56:46 +02:00
parent ed398280b7
commit 20c6ad2dfe

View File

@@ -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;