From 2c2cc8592eab8e1a3fe999ff8916703e8bf3cfb5 Mon Sep 17 00:00:00 2001 From: Fabien Costantini Date: Mon, 6 Oct 2008 19:20:49 +0000 Subject: Fixed a memory leak in new quartz window frame sizes detection routine. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6389 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_mac.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index 48eecd4cb..213b3a636 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -1620,8 +1620,8 @@ void handleUpdateEvent( WindowPtr xid ) // Gets the border sizes and the titlebar size static void get_window_frame_sizes(int &bx, int &by, int &bt) { #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2 - HIRect contentRect = { {50,50}, {100,100} }; // a rect to stand in for the content rect of a real window - HIThemeWindowDrawInfo metrics= {0, + static HIRect contentRect = { {50,50}, {100,100} }; // a rect to stand in for the content rect of a real window + static HIThemeWindowDrawInfo metrics= {0, kThemeStateActive, kThemeDocumentWindow, kThemeWindowHasFullZoom + kThemeWindowHasCloseBox + kThemeWindowHasCollapseBox + kThemeWindowHasTitleText, @@ -1641,7 +1641,7 @@ static void get_window_frame_sizes(int &bx, int &by, int &bt) { bt = rect3.size.height; bx = rect2.origin.x - rect1.origin.x; by = rect2.origin.y - rect1.origin.y - bt; - // fprintf(stderr, "GetThemeWindowRegion succeeded bx=%d by=%d bt=%d\n", bx, by, bt); + // fprintf(stderr, "HIThemeGetWindowShape succeeded bx=%d by=%d bt=%d\n", bx, by, bt); } else #endif // MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2 @@ -1649,12 +1649,12 @@ static void get_window_frame_sizes(int &bx, int &by, int &bt) { // sets default dimensions bx = by = 6; bt = 22; - // fprintf(stderr, "GetThemeWindowRegion failed, bx=%d by=%d bt=%d\n", bx, by, bt); + // fprintf(stderr, "HIThemeGetWindowShape failed, bx=%d by=%d bt=%d\n", bx, by, bt); } #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2 - if (shape1) free((void*) shape1); // we must free HIThemeGetWindowShape() (copied) handles - if (shape2) free((void*) shape2); - if (shape3) free((void*) shape3); + CFRelease(shape1); // we must free HIThemeGetWindowShape() (copied) handles + CFRelease(shape2); + CFRelease(shape3); #endif // MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2 } -- cgit v1.2.3