summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-09-28 14:41:40 +0000
committerManolo Gouy <Manolo>2016-09-28 14:41:40 +0000
commit42624dc17f5010763a182f3144cd97cd5667ceac (patch)
tree62c61a08e5288b3e4105c90c722b59bb2a6ff5e1
parent8ef05518bb7c123c7d09ee71bf5fdf521207b4d9 (diff)
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
-rw-r--r--src/Fl_cocoa.mm8
1 files 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;