From 42624dc17f5010763a182f3144cd97cd5667ceac Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 28 Sep 2016 14:41:40 +0000 Subject: Avoid possible autorelease warning message sent by "fluid -c" that calls Fl_Window::size_range() git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11992 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 20114daee..4fc12125d 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1824,15 +1824,15 @@ void Fl_Cocoa_Screen_Driver::disable_im() { // Gets the border sizes and the titlebar size static void get_window_frame_sizes(int &bx, int &by, int &bt) { - static bool first = true; - static int top, left, bottom; - if (first) { - first = false; + static int top = 0, left, bottom; + if (!top) { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSRect inside = { {20,20}, {100,100} }; NSRect outside = [NSWindow frameRectForContentRect:inside styleMask:NSTitledWindowMask]; left = int(outside.origin.x - inside.origin.x); bottom = int(outside.origin.y - inside.origin.y); top = int(outside.size.height - inside.size.height) - bottom; + [pool release]; } bx = left; by = bottom; -- cgit v1.2.3