bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix NSMenu retainCount problem


From: Quentin Mathé
Subject: [PATCH] Fix NSMenu retainCount problem
Date: Thu, 5 Feb 2004 15:51:43 +0100

Here is the patch, two exactly, I was talking about.

NSMenu.m patch reworks the notifications use in order that the menu itself hasn't be included in a notification until the notification is sent.

I'm less sure for the NSMenuView.m patch : it only removes few lines which seems to have no reason to be there and caused a retain on NSMenu. Must be confirmed.

NSMenu patch has fixed the code below :

NSMenu *menu = [[NSMenu alloc] initWithTitle:@"boum"];
[menu addItem:menuItem];
// now the menu retain count is still 1 and not higher

NSMenuView patch has fixed the code below :

NSMenu *menu = [[NSMenu alloc] initWithTitle:@"boum"];
[NSMenu popUpContextMenu:menu event:event view:view];
[menu release];
// now the menu is released and deallocated

Thanks,
Quentin.

--
Quentin Mathé
qmathe@club-internet.fr

Attachment: NSMenuView.m.patch
Description: Binary data

Attachment: NSMenu.m.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]