Skip to content

Commit

Permalink
Main_Window: fixed minor memleak using smart pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanAizek committed Mar 5, 2024
1 parent 4955961 commit c1e843c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Main_Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2983,12 +2983,12 @@ void Main_Window::on_actionShow_New_VM_Wizard_triggered()
this,
SLOT(VM_State_Changed(Virtual_Machine*, VM::VM_State)));

QListWidgetItem* item =
new QListWidgetItem(vm->Get_Machine_Name(), ui.Machines_List);
std::unique_ptr<QListWidgetItem> item(
new QListWidgetItem(vm->Get_Machine_Name(), ui.Machines_List));
item->setIcon(QIcon(vm->Get_Icon_Path()));
item->setData(256, vm->Get_UID());

ui.Machines_List->setCurrentItem(item);
ui.Machines_List->setCurrentItem(item.get());

Update_VM_Ui();

Expand Down

0 comments on commit c1e843c

Please sign in to comment.