From 715b146a8b692d485d877dfc2bf5548ec1a15f5b Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 13 Jun 2007 12:43:36 +0000 Subject: [PATCH] fixing 1736298 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/renderer.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mac/carbon/renderer.cpp b/src/mac/carbon/renderer.cpp index 37cc0e311b..2afc7a44df 100644 --- a/src/mac/carbon/renderer.cpp +++ b/src/mac/carbon/renderer.cpp @@ -149,8 +149,13 @@ int wxRendererMac::DrawHeaderButton( wxWindow *win, CGContextTranslateCTM( cgContext, 0, bounds.bottom - bounds.top ); CGContextScaleCTM( cgContext, 1, -1 ); - HIShapeReplacePathInCGContext( HIShapeCreateWithQDRgn( (RgnHandle) dc.m_macCurrentClipRgn ), cgContext ); - CGContextClip( cgContext ); + HIShapeRef shape = HIShapeCreateWithQDRgn( (RgnHandle) dc.m_macCurrentClipRgn ); + if ( shape != 0 ) + { + HIShapeReplacePathInCGContext( shape , cgContext ); + CFRelease( shape ); + CGContextClip( cgContext ); + } HIViewConvertRect( &headerRect, (HIViewRef) win->GetHandle(), (HIViewRef) win->MacGetTopLevelWindow()->GetHandle() ); #endif