From 78fdb8a758d9a6a2fd31d8bb222186e26dc338cc Mon Sep 17 00:00:00 2001 From: Kevin Walzer Date: Sat, 21 Mar 2015 03:21:25 +0000 Subject: Final cleanup of zombie windows in Cocoa --- macosx/tkMacOSXEvent.c | 9 +++------ macosx/tkMacOSXWm.c | 2 ++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index 365dc9b..db13249 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -133,13 +133,10 @@ TkMacOSXFlushWindows(void) */ NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSArray *macWindows = [NSApp orderedWindows]; - NSInteger windowCount = [macWindows count]; - if(windowCount) { - for (NSWindow *w in macWindows) { - if (TkMacOSXGetXWindow(w)) { - [w flushWindow]; - } + for (NSWindow *w in macWindows) { + if (TkMacOSXGetXWindow(w)) { + [w flushWindow]; } } [pool drain]; diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 8866118..417f130 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -790,6 +790,7 @@ TkWmDeadWindow( NSWindow *window = wmPtr->window; if (window && !Tk_IsEmbedded(winPtr) ) { + NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSWindow *parent = [window parentWindow]; if (parent) { [parent removeChildWindow:window]; @@ -809,6 +810,7 @@ TkWmDeadWindow( [front makeKeyAndOrderFront:NSApp]; } } + [pool drain]; } ckfree(wmPtr); winPtr->wmInfoPtr = NULL; -- cgit v0.12