forked from qt-creator/qt-creator
Clang: fix heap-use-after-free of ClangCompletionAssistProcessor
Do not delete the ClangCompletionAssistProcessor when resetting the BackendReceiver since the CodeAssist is the owner of the processor. The processor will be deleted in the async completion handler set in CodeAssistantPrivate::requestProposal. Task-number: QTCREATORBUG-24151 Change-Id: I36cdfd6412cc6ed2b2658e8691f9f4217790affc Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -159,10 +159,8 @@ bool BackendReceiver::isExpectingCompletionsMessage() const
|
||||
void BackendReceiver::reset()
|
||||
{
|
||||
// Clean up waiting assist processors
|
||||
for (ClangCompletionAssistProcessor *processor : m_assistProcessorsTable) {
|
||||
for (ClangCompletionAssistProcessor *processor : m_assistProcessorsTable)
|
||||
processor->setAsyncProposalAvailable(nullptr);
|
||||
delete processor;
|
||||
}
|
||||
m_assistProcessorsTable.clear();
|
||||
|
||||
// Clean up futures for references; TODO: Remove duplication
|
||||
|
Reference in New Issue
Block a user