Skip to content

Commit

Permalink
[cling] Delete UITabCompletion* with unique_ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyilism authored and Axel-Naumann committed Nov 19, 2022
1 parent 278fdbb commit 323c214
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions interpreter/cling/lib/UserInterface/UserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace {
///
class UITabCompletion : public textinput::TabCompletion {
const cling::Interpreter& m_ParentInterpreter;

public:
UITabCompletion(const cling::Interpreter& Parent) :
m_ParentInterpreter(Parent) {}
Expand Down Expand Up @@ -89,13 +89,11 @@ namespace cling {
llvm::sys::path::append(histfilePath, ".cling_history");
}

const auto Completion =
std::make_unique<UITabCompletion>(m_MetaProcessor->getInterpreter());
TextInputHolder TI(histfilePath);

// Inform text input about the code complete consumer
// TextInput owns the TabCompletion.
UITabCompletion* Completion =
new UITabCompletion(m_MetaProcessor->getInterpreter());
TI->SetCompletion(Completion);
TI->SetCompletion(Completion.get());

bool Done = false;
std::string Line;
Expand Down

0 comments on commit 323c214

Please sign in to comment.