make sure we always restore the passed in cg in a paint event
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 31 Oct 2006 08:39:08 +0000 (08:39 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 31 Oct 2006 08:39:08 +0000 (08:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/dcclient.cpp

index 7023f8cc9f237e3ab49a57e2c7a1e58b9f458e4a..3fab6f98e2eba9430d4b4f8436e37f505e39ca3e 100644 (file)
@@ -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
 }