summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXInit.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2016-01-09 03:03:29 (GMT)
committerKevin Walzer <kw@codebykevin.com>2016-01-09 03:03:29 (GMT)
commite07b10f1a79f05875a092a57edd405f0e23f7345 (patch)
tree8220188017056eedba5ede831ddd2a1e73044b38 /macosx/tkMacOSXInit.c
parent52598f831a2b67fd2feb6317fb7fca9828712cf5 (diff)
downloadtk-e07b10f1a79f05875a092a57edd405f0e23f7345.zip
tk-e07b10f1a79f05875a092a57edd405f0e23f7345.tar.gz
tk-e07b10f1a79f05875a092a57edd405f0e23f7345.tar.bz2
Additional fixes for memory leaks, window flickering on OS X 10.11; thanks to Marc Culler for patch
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r--macosx/tkMacOSXInit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index cb97f47..26eb3f5 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.c
@@ -72,11 +72,13 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt
_mainPool = [NSAutoreleasePool new];
}
}
+
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
- (void)_postedNotification:(NSNotification *)notification {
TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
}
#endif
+
- (void)_setupApplicationNotifications {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
#define observe(n, s) [nc addObserver:self selector:@selector(s) name:(n) object:nil]
@@ -91,18 +93,19 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt
CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), NULL, &keyboardChanged, kTISNotifySelectedKeyboardInputSourceChanged, NULL, CFNotificationSuspensionBehaviorCoalesce);
#endif
}
+
- (void)_setupEventLoop {
NSAutoreleasePool *pool = [NSAutoreleasePool new];
[self finishLaunching];
[self setWindowsNeedUpdate:YES];
[pool drain];
}
+
- (void)_setup:(Tcl_Interp *)interp {
_eventInterp = interp;
- _mainPool = nil;
+ _mainPool = [NSAutoreleasePool new];
[NSApp setPoolProtected:NO];
_defaultMainMenu = nil;
- NSAutoreleasePool *pool = [NSAutoreleasePool new];
[self _setupMenus];
[self setDelegate:self];
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
@@ -111,8 +114,8 @@ static void keyboardChanged(CFNotificationCenterRef center, void *observer, CFSt
#endif
[self _setupWindowNotifications];
[self _setupApplicationNotifications];
- [pool drain];
}
+
- (NSString *)tkFrameworkImagePath:(NSString*)image {
NSString *path = nil;
NSAutoreleasePool *pool = [NSAutoreleasePool new];