From bc8ebd3bc73501c7c51fbb00366d4211ccba6d5a Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 20 Jul 2022 19:03:10 +0200 Subject: [PATCH] CodeAssistant: Avoid using sender() Change-Id: I8483b368ebf5dca684d817390e1138362bf11d6f Reviewed-by: David Schulz Reviewed-by: --- src/plugins/texteditor/codeassist/codeassistant.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index d0e5d37812b..c6ecaa4de72 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -240,10 +240,10 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason, m_requestRunner = new ProcessorRunner; m_runnerConnection = connect(m_requestRunner, &ProcessorRunner::finished, - this, [this, reason](){ + this, [this, reason, sender = m_requestRunner] { // Since the request runner is a different thread, there's still a gap in which the // queued signal could be processed after an invalidation of the current request. - if (!m_requestRunner || m_requestRunner != sender()) + if (!m_requestRunner || m_requestRunner != sender) return; IAssistProposal *proposal = m_requestRunner->proposal(); @@ -264,7 +264,7 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason, IAssistProposal *newProposal) { if (!processor->running()) { // do not delete this processor directly since this function is called from within the processor - QMetaObject::invokeMethod(QCoreApplication::instance(), [processor]() { + QMetaObject::invokeMethod(QCoreApplication::instance(), [processor] { delete processor; }, Qt::QueuedConnection); }