diff --git a/atom/browser/api/atom_api_menu.cc b/atom/browser/api/atom_api_menu.cc index 393468bec78e3..e9d05361cd156 100644 --- a/atom/browser/api/atom_api_menu.cc +++ b/atom/browser/api/atom_api_menu.cc @@ -156,8 +156,8 @@ base::string16 Menu::GetSublabelAt(int index) const { } base::string16 Menu::GetAcceleratorTextAt(int index) const { - auto* accelerator = new ui::Accelerator(); - model_->GetAcceleratorAtWithParams(index, true, accelerator); + std::unique_ptr accelerator(new ui::Accelerator()); + model_->GetAcceleratorAtWithParams(index, true, accelerator.get()); return accelerator ? accelerator->GetShortcutText() : base::string16(); }