summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-12-10 13:38:45 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-12-10 13:38:45 (GMT)
commit87dca641534768e549dd5ff1d43f7111ae4ef578 (patch)
tree00c84bb0c26550694f45ebb9331efe2c9b5bd4bb /macosx/tkMacOSXWm.c
parenta24fdcc2b9295b493a9cd9e7632be98c5ddb3f6a (diff)
parente82200cb0ca4389ea75f8ae0c2096358a985c14e (diff)
downloadtk-87dca641534768e549dd5ff1d43f7111ae4ef578.zip
tk-87dca641534768e549dd5ff1d43f7111ae4ef578.tar.gz
tk-87dca641534768e549dd5ff1d43f7111ae4ef578.tar.bz2
merge 8.5
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r--macosx/tkMacOSXWm.c46
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];
}
/*