aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/languageclient/languageclientfunctionhint.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2020-03-26 09:21:57 +0100
committerDavid Schulz <david.schulz@qt.io>2020-05-12 08:24:41 +0000
commit8bde432dfe40ff9b9491acd62a7854c060cad01d (patch)
treea9d5c2d21c992ddb26c6ff288d7fa2f202156774 /src/plugins/languageclient/languageclientfunctionhint.cpp
parentda3b14faee5bcc0f0238aa35d768c2d71a34b24c (diff)
CodeAssist: Fix leaking asynchronous processors
Currently the ownership of the processor is unknown to the codeassist when running an async operation. Move the ownership of the processor to the assist and delete the processor after the proposal was completed. Change-Id: I6a2e023c47cbc876669dba866bee12b481447cb7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/languageclient/languageclientfunctionhint.cpp')
-rw-r--r--src/plugins/languageclient/languageclientfunctionhint.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/languageclient/languageclientfunctionhint.cpp b/src/plugins/languageclient/languageclientfunctionhint.cpp
index 3361864973..8b47b73458 100644
--- a/src/plugins/languageclient/languageclientfunctionhint.cpp
+++ b/src/plugins/languageclient/languageclientfunctionhint.cpp
@@ -96,6 +96,7 @@ void FunctionHintProcessor::cancel()
{
if (running()) {
m_client->cancelRequest(m_currentRequest);
+ m_client->removeAssistProcessor(this);
m_currentRequest = MessageId();
}
}
@@ -107,6 +108,7 @@ void FunctionHintProcessor::handleSignatureResponse(const SignatureHelpRequest::
m_client->log(error.value());
FunctionHintProposalModelPtr model(
new FunctionHintProposalModel(response.result().value().value()));
+ m_client->removeAssistProcessor(this);
setAsyncProposalAvailable(new FunctionHintProposal(m_pos, model));
}