Skip to content

Commit

Permalink
fix: ensure that temporary accelerator is destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
brenca committed Oct 30, 2018
1 parent 569e264 commit 976b4d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions atom/browser/api/atom_api_menu.cc
Expand Up @@ -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<ui::Accelerator> accelerator(new ui::Accelerator());
model_->GetAcceleratorAtWithParams(index, true, accelerator.get());

return accelerator ? accelerator->GetShortcutText() : base::string16();
}
Expand Down

0 comments on commit 976b4d1

Please sign in to comment.