# HG changeset patch # User mcherkas # Date 1414611218 -14400 # Node ID 319ceec1d2f8e0ce8e0e2ec187086bf1960278cf # Parent acb5d48ed0dadb622a115c88af934d1c20f0d84d 8041572: [macosx] huge native memory leak in AWTWindow.m Reviewed-by: pchelko, serb diff -r acb5d48ed0da -r 319ceec1d2f8 src/macosx/native/sun/awt/AWTWindow.m --- a/src/macosx/native/sun/awt/AWTWindow.m Wed Jul 23 20:14:02 2014 +0100 +++ b/src/macosx/native/sun/awt/AWTWindow.m Wed Oct 29 23:33:38 2014 +0400 @@ -320,7 +320,8 @@ // return id for the topmost window under mouse + (NSInteger) getTopmostWindowUnderMouseID { - + NSInteger result = -1; + NSRect screenRect = [[NSScreen mainScreen] frame]; NSPoint nsMouseLocation = [NSEvent mouseLocation]; CGPoint cgMouseLocation = CGPointMake(nsMouseLocation.x, screenRect.size.height - nsMouseLocation.y); @@ -334,11 +335,13 @@ CGRect rect; CGRectMakeWithDictionaryRepresentation((CFDictionaryRef)[window objectForKey:(id)kCGWindowBounds], &rect); if (CGRectContainsPoint(rect, cgMouseLocation)) { - return [[window objectForKey:(id)kCGWindowNumber] integerValue]; + result = [[window objectForKey:(id)kCGWindowNumber] integerValue]; + break; } } } - return -1; + [windows release]; + return result; } // checks that this window is under the mouse cursor and this point is not overlapped by other windows