diff options
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r-- | macosx/tkMacOSXWm.c | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 69d3cfb..4ce2206 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -390,6 +390,7 @@ static void RemapWindows(TkWindow *winPtr, @end @implementation TKWindow(TKWm) + - (BOOL) canBecomeKeyWindow { TkWindow *winPtr = TkMacOSXGetTkWindow(self); @@ -399,16 +400,38 @@ static void RemapWindows(TkWindow *winPtr, kWindowNoActivatesAttribute)) ? NO : YES; } +#if DEBUG_ZOMBIES - (id) retain { -#if DEBUG_ZOMBIES + id result = [super retain]; const char *title = [[self title] UTF8String]; - if (title != NULL) { - printf("Retaining %s with count %lu\n", title, [self retainCount]); + if (title == nil) { + title = "unnamed window"; } -#endif - return [super retain]; + printf("Retained <%s>. Count is: %lu\n", title, [self retainCount]); + return result; +} + +- (id) autorelease +{ + id result = [super autorelease]; + const char *title = [[self title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + printf("Autoreleased <%s>. Count is %lu\n", title, [self retainCount]); + return result; +} + +- (oneway void) release { + const char *title = [[self title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + printf("Releasing <%s>. Count is %lu\n", title, [self retainCount]); + [super release]; } +#endif @end #pragma mark - @@ -847,6 +870,15 @@ TkWmDeadWindow( if (winPtr->window) { ((MacDrawable *) winPtr->window)->view = nil; } +#if DEBUG_ZOMBIES + { + const char *title = [[window title] UTF8String]; + if (title == nil) { + title = "unnamed window"; + } + printf("Closing <%s>. Count is: %lu\n", title, [window retainCount]); + } +#endif [window release]; wmPtr->window = NULL; /* Activate the highest window left on the screen. */ @@ -5447,6 +5479,8 @@ TkMacOSXMakeRealWindowExist( */ } + NSAutoreleasePool *pool = [NSAutoreleasePool new]; + WindowClass macClass = wmPtr->macClass; wmPtr->attributes &= (tkAlwaysValidAttributes | macClassAttrs[macClass].validAttrs); @@ -5530,6 +5564,8 @@ TkMacOSXMakeRealWindowExist( TkMacOSXRegisterOffScreenWindow((Window) macWin, window); macWin->flags |= TK_HOST_EXISTS; + + [pool drain]; } /* |