Author: manolo
Date: 2011-04-05 09:41:31 -0700 (Tue, 05 Apr 2011)
New Revision: 8561
Log:
Removed an NSAutoreleasePool allocation/release.

Modified:
   branches/branch-1.3/src/Fl_cocoa.mm

Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2011-04-05 16:20:02 UTC (rev 8560)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-04-05 16:41:31 UTC (rev 8561)
@@ -1386,14 +1386,11 @@
 
 // Gets the border sizes and the titlebar size
 static void get_window_frame_sizes(int &bx, int &by, int &bt) {
-  NSAutoreleasePool *localPool;
-  localPool = [[NSAutoreleasePool alloc] init]; 
   NSRect inside = { {20,20}, {100,100} };
   NSRect outside = [NSWindow  frameRectForContentRect:inside 
styleMask:NSTitledWindowMask];
   bx = int(outside.origin.x - inside.origin.x);
   by = int(outside.origin.y - inside.origin.y);
   bt = int(outside.size.height - inside.size.height - by);
-  [localPool release];
 }
 
 /*
@@ -2172,9 +2169,6 @@
  * resize a window
  */
 void Fl_Window::resize(int X,int Y,int W,int H) {
-  int bx, by, bt;
-  if ( ! this->border() ) bt = 0;
-  else get_window_frame_sizes(bx, by, bt);
   if (W<=0) W = 1; // OS X does not like zero width windows
   if (H<=0) H = 1;
   int is_a_resize = (W != w() || H != h());
@@ -2193,6 +2187,9 @@
       } else {
         size_range(W, H, W, H);
       }
+      int bx, by, bt;
+      if ( ! this->border() ) bt = 0;
+      else get_window_frame_sizes(bx, by, bt);
       NSRect dim;
       dim.origin.x = X;
       dim.origin.y = [[(NSWindow*)i->xid screen] frame].size.height - (Y + H);

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to