aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/clangcodemodel
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/clangcodemodel
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/clangcodemodel')
-rw-r--r--src/plugins/clangcodemodel/clangbackendreceiver.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/clangcodemodel/clangbackendreceiver.cpp b/src/plugins/clangcodemodel/clangbackendreceiver.cpp
index 39edf46c44..a0fac08854 100644
--- a/src/plugins/clangcodemodel/clangbackendreceiver.cpp
+++ b/src/plugins/clangcodemodel/clangbackendreceiver.cpp
@@ -190,8 +190,7 @@ void BackendReceiver::completions(const CompletionsMessage &message)
<< "items";
const quint64 ticket = message.ticketNumber;
- QScopedPointer<ClangCompletionAssistProcessor> processor(m_assistProcessorsTable.take(ticket));
- if (processor)
+ if (ClangCompletionAssistProcessor *processor = m_assistProcessorsTable.take(ticket))
processor->handleAvailableCompletions(message.codeCompletions);
}