summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXMenu.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2015-03-21 01:22:36 (GMT)
committerKevin Walzer <kw@codebykevin.com>2015-03-21 01:22:36 (GMT)
commited79116517a5979ed583a4b0245e64a13db47502 (patch)
treeaecf3fb93bddea1561e21b4945307339af8f0d7e /macosx/tkMacOSXMenu.c
parent969c53ce2f9727a2a2c5f31ca56f540ebfc3bf2c (diff)
downloadtk-ed79116517a5979ed583a4b0245e64a13db47502.zip
tk-ed79116517a5979ed583a4b0245e64a13db47502.tar.gz
tk-ed79116517a5979ed583a4b0245e64a13db47502.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 472520f..5ae38f8 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