mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Fix crash (but not hang) when Gecko alert opens above Cocoa modal Save As dialog. b=468393 r=josh sr=roc
This commit is contained in:
parent
ccf93ca8cb
commit
77280dc541
@ -130,15 +130,17 @@ nsMenuBarX* nsMenuUtilsX::GetHiddenWindowMenuBar()
|
||||
|
||||
|
||||
// It would be nice if we could localize these edit menu names.
|
||||
static NSMenuItem* standardEditMenuItem = nil;
|
||||
NSMenuItem* nsMenuUtilsX::GetStandardEditMenuItem()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
||||
if (standardEditMenuItem)
|
||||
return standardEditMenuItem;
|
||||
|
||||
standardEditMenuItem = [[NSMenuItem alloc] initWithTitle:@"Edit" action:nil keyEquivalent:@""];
|
||||
// In principle we should be able to allocate this once and then always
|
||||
// return the same object. But wierd interactions happen between native
|
||||
// app-modal dialogs and Gecko-modal dialogs that open above them. So what
|
||||
// we return here isn't always released before it needs to be added to
|
||||
// another menu. See bmo bug 468393.
|
||||
NSMenuItem* standardEditMenuItem =
|
||||
[[[NSMenuItem alloc] initWithTitle:@"Edit" action:nil keyEquivalent:@""] autorelease];
|
||||
NSMenu* standardEditMenu = [[NSMenu alloc] initWithTitle:@"Edit"];
|
||||
[standardEditMenuItem setSubmenu:standardEditMenu];
|
||||
[standardEditMenu release];
|
||||
|
Loading…
Reference in New Issue
Block a user