TextEditor: Fix potential memory leak in code assist

Manually managing the ownership of the code assist objets gets messy. We
should use smart pointers.

Change-Id: I29fe665e52438a79c3268b74898c583bb302f1fc
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-07-29 12:28:19 +02:00
parent f4796d0032
commit 5145fc8509

View File

@@ -229,8 +229,10 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
m_assistKind = kind;
IAssistProcessor *processor = provider->createProcessor();
AssistInterface *assistInterface = m_editorWidget->createAssistInterface(kind, reason);
if (!assistInterface)
if (!assistInterface) {
delete processor;
return;
}
switch (provider->runType()) {
case IAssistProvider::Synchronous: {