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)
commit50ec1ecb24801b023618048a6704fa12670671d9 (patch)
treeaecf3fb93bddea1561e21b4945307339af8f0d7e /macosx/tkMacOSXMenu.c
parentf22c4207e5275f1e2c792672b41f6828372d6203 (diff)
downloadtk-50ec1ecb24801b023618048a6704fa12670671d9.zip
tk-50ec1ecb24801b023618048a6704fa12670671d9.tar.gz
tk-50ec1ecb24801b023618048a6704fa12670671d9.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