X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ca21fe7bfda18e2da4e17eb529c4dfa0c824db2..e8481866872d3eec6e0ce1fa7eab856abff26c34:/src/generic/graphicc.cpp?ds=sidebyside diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index 5e7da3dcba..c89d338f51 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 2006-10-03 -// RCS-ID: $Id$ // Copyright: (c) 2006 Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -1655,7 +1654,9 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxPrinterDC& #ifdef __WXGTK20__ const wxDCImpl *impl = dc.GetImpl(); - Init( (cairo_t*) impl->GetCairoContext() ); + cairo_t* cr = static_cast(impl->GetCairoContext()); + if (cr) + Init(cairo_reference(cr)); #endif wxSize sz = dc.GetSize(); m_width = sz.x; @@ -1701,7 +1702,7 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxWindowDC& #ifdef __WXGTK3__ cairo_t* cr = static_cast(dc.GetImpl()->GetCairoContext()); if (cr) - Init(cr); + Init(cairo_reference(cr)); #elif defined __WXGTK20__ wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl(); Init( gdk_cairo_create( impldc->GetGDKWindow() ) ); @@ -1776,7 +1777,7 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxMemoryDC& #ifdef __WXGTK3__ cairo_t* cr = static_cast(dc.GetImpl()->GetCairoContext()); if (cr) - Init(cr); + Init(cairo_reference(cr)); #elif defined __WXGTK20__ wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl(); Init( gdk_cairo_create( impldc->GetGDKWindow() ) );