Author: dpsimons
Date: Wed Mar 10 00:11:40 2010
New Revision: 29891

URL: http://svn.gna.org/viewcvs/gnustep?rev=29891&view=rev
Log:
protect changedMessagesEnabled flag; update menus after modal session, key or
main window change

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Source/NSApplication.m
    libs/gui/trunk/Source/NSMenu.m


Hi Doug,

what is the reason for inserting those [_main_menu update] calls in NSApplication -endModalSession:, -_windowDidBecomeKey:, and - _windowDidBecomeMain:?

These method calls (well at least the latter two) seem to be causing crashes in various applications including ProjectCenter when closing a window. This can happen if focus is shifted temporarily by NSWindow _lossOfKeyOrMainWindow to a window which is about to be closed and in an inconsistent state (e.g., its delegate being deallocated already) because the update method of NSMenu attempts to validate all menu items.

AFAICT, [_main_menu update] is called at the end of every event cycle anyway (well, except when an exception is thrown, but this could be fixed if necessary), so calling [_main_menu update] in those other places looks redundant to me.

Wolfgang


_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to