diff --git a/src/mac/carbon/dcclient.cpp b/src/mac/carbon/dcclient.cpp index 7023f8cc9f..3fab6f98e2 100644 --- a/src/mac/carbon/dcclient.cpp +++ b/src/mac/carbon/dcclient.cpp @@ -165,11 +165,12 @@ wxWindowDC::wxWindowDC(wxWindow *window) wxWindowDC::~wxWindowDC() { #if wxMAC_USE_CORE_GRAPHICS - if ( m_release && m_graphicContext ) + if ( m_release ) { + // this must not necessarily be the current context, we must restore the state of the + // cg we started with above (before the CGContextTranslateCTM call) CGContextRef cg = (CGContextRef) m_window->MacGetCGContextRef(); CGContextRestoreGState(cg); - //CGContextRef cg = (CGContextRef) m_graphicContext->GetNativeContext() ; } #endif }