Delete UITabCompletion* with unique_ptr
This commit is contained in:
parent
7f3ede672b
commit
7c1e968336
@ -31,7 +31,7 @@ namespace {
|
|||||||
///
|
///
|
||||||
class UITabCompletion : public textinput::TabCompletion {
|
class UITabCompletion : public textinput::TabCompletion {
|
||||||
const cling::Interpreter& m_ParentInterpreter;
|
const cling::Interpreter& m_ParentInterpreter;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UITabCompletion(const cling::Interpreter& Parent) :
|
UITabCompletion(const cling::Interpreter& Parent) :
|
||||||
m_ParentInterpreter(Parent) {}
|
m_ParentInterpreter(Parent) {}
|
||||||
@ -89,13 +89,11 @@ namespace cling {
|
|||||||
llvm::sys::path::append(histfilePath, ".cling_history");
|
llvm::sys::path::append(histfilePath, ".cling_history");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto Completion =
|
||||||
|
std::make_unique<UITabCompletion>(m_MetaProcessor->getInterpreter());
|
||||||
TextInputHolder TI(histfilePath);
|
TextInputHolder TI(histfilePath);
|
||||||
|
|
||||||
// Inform text input about the code complete consumer
|
TI->SetCompletion(Completion.get());
|
||||||
// TextInput owns the TabCompletion.
|
|
||||||
UITabCompletion* Completion =
|
|
||||||
new UITabCompletion(m_MetaProcessor->getInterpreter());
|
|
||||||
TI->SetCompletion(Completion);
|
|
||||||
|
|
||||||
bool Done = false;
|
bool Done = false;
|
||||||
std::string Line;
|
std::string Line;
|
||||||
|
Loading…
Reference in New Issue
Block a user