forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user