Commit f4adc00b authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppEditor: Tests: Fix leaking IAssistProcessor and IAssistProposal

...in VirtualFunctionTestAssistProvider.

Change-Id: I6472a599ca12d72e8df8e6f416eaa02c27ef1cc6
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent af34a5b9
......@@ -34,6 +34,8 @@
#include "cppvirtualfunctionassistprovider.h"
#include "cppvirtualfunctionproposalitem.h"
#include <cpptools/cpptoolstestcase.h>
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/codeassist/iassistprocessor.h>
#include <texteditor/codeassist/iassistproposal.h>
......@@ -123,16 +125,19 @@ public:
{
VirtualFunctionAssistProvider::configure(params);
IAssistProcessor *processor = createProcessor();
const QScopedPointer<IAssistProcessor> processor(createProcessor());
AssistInterface *assistInterface
= m_editorWidget->createAssistInterface(FollowSymbol, ExplicitlyInvoked);
IAssistProposal *immediateProposal = processor->immediateProposal(assistInterface);
IAssistProposal *finalProposal = processor->perform(assistInterface);
using CppTools::Tests::IAssistProposalScopedPointer;
const IAssistProposalScopedPointer immediateProposal(
processor->immediateProposal(assistInterface));
const IAssistProposalScopedPointer finalProposal(processor->perform(assistInterface));
VirtualFunctionAssistProvider::clearParams();
m_immediateItems = itemList(immediateProposal->model());
m_finalItems = itemList(finalProposal->model());
m_immediateItems = itemList(immediateProposal.d->model());
m_finalItems = itemList(finalProposal.d->model());
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment