diff options
| author | Fabien Costantini <fabien@onepost.net> | 2008-10-06 19:20:49 +0000 |
|---|---|---|
| committer | Fabien Costantini <fabien@onepost.net> | 2008-10-06 19:20:49 +0000 |
| commit | 2c2cc8592eab8e1a3fe999ff8916703e8bf3cfb5 (patch) | |
| tree | 869f6dd11ab5710f9c50c3e663de91f364c81b67 | |
| parent | aca18384b7a399fc06ac3c5eaf7e020e7a09ecf4 (diff) | |
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
| -rw-r--r-- | src/Fl_mac.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
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 } |
