ClangCodeModel: fix memory leak

amends 45317da25a

Change-Id: I27d3332f1a99676c174f18ff06d0cf0cea396b70
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
David Schulz
2022-11-11 08:08:14 +01:00
parent cc196096e7
commit 574d64436a

View File

@@ -152,7 +152,11 @@ IAssistProcessor *ClangdCompletionAssistProvider::createProcessor(
if (contextAnalyzer.completionAction() if (contextAnalyzer.completionAction()
!= ClangCompletionContextAnalyzer::CompleteIncludePath) { != ClangCompletionContextAnalyzer::CompleteIncludePath) {
class NoOpProcessor : public IAssistProcessor { class NoOpProcessor : public IAssistProcessor {
IAssistProposal *perform(const AssistInterface *) override { return nullptr; } IAssistProposal *perform(const AssistInterface *interface) override
{
delete interface;
return nullptr;
}
}; };
return new NoOpProcessor; return new NoOpProcessor;
} }