summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMenu.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-03-21 01:22:30 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-03-21 01:22:30 (GMT)
commit6596343ef6a711a8b5a51e17c946f206a90efe16 (patch)
treeaa5390457f8371d6bf3eb56d179db157eaecc722 /macosx/tkMacOSXMenu.c
parent4f6c1ad7943f8c595d9d539a6c6c33c96832554b (diff)
downloadtk-6596343ef6a711a8b5a51e17c946f206a90efe16.zip
tk-6596343ef6a711a8b5a51e17c946f206a90efe16.tar.gz
tk-6596343ef6a711a8b5a51e17c946f206a90efe16.tar.bz2
Cleanup and simplification of memory management in event loop; now works more smoothly; thanks to Marc Culler for patches
Diffstat (limited to 'macosx/tkMacOSXMenu.c')
-rw-r--r--macosx/tkMacOSXMenu.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 9f14f47..0cc874c 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -375,6 +375,13 @@ static int ModifierCharWidth(Tk_Font tkfont);
@implementation TKApplication(TKMenu)
+- (void) safeSetMainMenu: (NSMenu *) menu
+{
+ NSAutoreleasePool* pool = [NSAutoreleasePool new];
+ [self setMainMenu: menu];
+ [pool drain];
+}
+
- (void) menuBeginTracking: (NSNotification *) notification
{
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
@@ -466,7 +473,7 @@ static int ModifierCharWidth(Tk_Font tkfont);
[servicesMenuItem setSubmenu:_servicesMenu];
}
[self setAppleMenu:applicationMenu];
- [self setMainMenu:menu];
+ [self safeSetMainMenu:menu];
}
@end