bug-gnustep
[Top][All Lists]
Advanced

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

Re: NSMenu


From: Quentin Mathé
Subject: Re: NSMenu
Date: Thu, 5 Feb 2004 02:57:01 +0100

Le 4 févr. 04, à 23:17, Fred Kiefer a écrit :

Quentin Mathé wrote:

NSMenuItem autoenabling doesn't work with NSPopUpButton... is it an unimplemented feature ?
other problem... with the code below :
NSMenu *menu = [[NSMenu alloc] initWithTitle:@""];
[NSMenu popUpContextMenu:menu withEvent:myEvent forView:myView];
RELEASE(menu);
the menu object doesn't seem to be released (its dealloc method is not called)... Why ?

This seems to eb a real bug, so lets move teh discussion to this mailing list.

My impression after a short inspection is that the problem comes from the fact that a menu allways registers itself with the notification centre, which in turn will keep a reference to the object thereby keeping it alive. But I might be wrong here, as many classes in GUI use a similar pattern and would thereby be living longer than expected. Coudl somebody with mre knowledge of the implementation of NSNotificationCenter comment on this?

Than this problem would even exist in the above code if the menu is only created and released later. Is this true?

Yes. That is the problem (NSNotificationCenter implementation is ok, but we cannot use it like it is in NSMenu currently), but there is also an other one with GSTitleView. I have fixed both, but for the last not really sure... Will post a patch tomorrow as I have stated on discuss-. Sorry, I have missed your message when I decided to reply to my message on discuss-.

Quentin.

--
Quentin Mathé
address@hidden




reply via email to

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