mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Memory safety
This commit is contained in:
@@ -20,7 +20,7 @@ using content::BrowserThread;
|
||||
|
||||
namespace {
|
||||
|
||||
static NSMenu* applicationMenu_ = nil;
|
||||
static scoped_nsobject<NSMenu> applicationMenu_;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -146,7 +146,7 @@ void Menu::SetApplicationMenu(Menu* base_menu) {
|
||||
[currentRunLoop cancelPerformSelector:@selector(setMainMenu:)
|
||||
target:NSApp
|
||||
argument:applicationMenu_];
|
||||
applicationMenu_ = [menu_controller menu];
|
||||
applicationMenu_.reset([[menu_controller menu] retain]);
|
||||
[[NSRunLoop currentRunLoop]
|
||||
performSelector:@selector(setMainMenu:)
|
||||
target:NSApp
|
||||
|
||||
Reference in New Issue
Block a user