forked from qt-creator/qt-creator
LanguageClient: fix crash on completion assist cancel
The Client might be already deleted when the text editor codeassist calls cancel on the processor. Change-Id: I6b0b484a086456ed9d0543f530aea0fae32c523a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -392,8 +392,10 @@ bool LanguageClientCompletionAssistProcessor::running()
|
|||||||
void LanguageClientCompletionAssistProcessor::cancel()
|
void LanguageClientCompletionAssistProcessor::cancel()
|
||||||
{
|
{
|
||||||
if (m_currentRequest.has_value()) {
|
if (m_currentRequest.has_value()) {
|
||||||
|
if (m_client) {
|
||||||
m_client->cancelRequest(m_currentRequest.value());
|
m_client->cancelRequest(m_currentRequest.value());
|
||||||
m_client->removeAssistProcessor(this);
|
m_client->removeAssistProcessor(this);
|
||||||
|
}
|
||||||
m_currentRequest.reset();
|
m_currentRequest.reset();
|
||||||
} else if (m_postponedUpdateConnection) {
|
} else if (m_postponedUpdateConnection) {
|
||||||
QObject::disconnect(m_postponedUpdateConnection);
|
QObject::disconnect(m_postponedUpdateConnection);
|
||||||
|
|||||||
Reference in New Issue
Block a user