From 5b4693aaa45e851a3157e13897a02ee41577cc89 Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Tue, 7 Aug 2007 15:00:36 -0700 Subject: [PATCH] Bug 390707. Don't leak mNativeMenuItem, fixes wicked Mac crash. patch by jag, r=hwaara,josh,sr=vlad --- widget/src/cocoa/nsMenuX.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/widget/src/cocoa/nsMenuX.mm b/widget/src/cocoa/nsMenuX.mm index 78fd49efceb..e99825cbde7 100644 --- a/widget/src/cocoa/nsMenuX.mm +++ b/widget/src/cocoa/nsMenuX.mm @@ -297,6 +297,7 @@ nsresult nsMenuX::AddMenu(nsIMenu * aMenu) PRBool enabled; aMenu->GetEnabled(&enabled); NSString *newCocoaLabelString = MenuHelpersX::CreateTruncatedCocoaLabel(label); + [mNativeMenuItem release]; mNativeMenuItem = [[NSMenuItem alloc] initWithTitle:newCocoaLabelString action:nil keyEquivalent:@""]; [mNativeMenuItem setEnabled:enabled]; [mMacMenu addItem:mNativeMenuItem];