It was assumed that all callers were going to unref the cairo_t, but that is not
true, so callers that are going to unref it should ref it themselves.
See #15455
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74746
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#ifdef __WXGTK20__
const wxDCImpl *impl = dc.GetImpl();
#ifdef __WXGTK20__
const wxDCImpl *impl = dc.GetImpl();
- Init( (cairo_t*) impl->GetCairoContext() );
+ cairo_t* cr = static_cast<cairo_t*>(impl->GetCairoContext());
+ if (cr)
+ Init(cairo_reference(cr));
#endif
wxSize sz = dc.GetSize();
m_width = sz.x;
#endif
wxSize sz = dc.GetSize();
m_width = sz.x;
#ifdef __WXGTK3__
cairo_t* cr = static_cast<cairo_t*>(dc.GetImpl()->GetCairoContext());
if (cr)
#ifdef __WXGTK3__
cairo_t* cr = static_cast<cairo_t*>(dc.GetImpl()->GetCairoContext());
if (cr)
+ Init(cairo_reference(cr));
#elif defined __WXGTK20__
wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
Init( gdk_cairo_create( impldc->GetGDKWindow() ) );
#elif defined __WXGTK20__
wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
Init( gdk_cairo_create( impldc->GetGDKWindow() ) );
#ifdef __WXGTK3__
cairo_t* cr = static_cast<cairo_t*>(dc.GetImpl()->GetCairoContext());
if (cr)
#ifdef __WXGTK3__
cairo_t* cr = static_cast<cairo_t*>(dc.GetImpl()->GetCairoContext());
if (cr)
+ Init(cairo_reference(cr));
#elif defined __WXGTK20__
wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
Init( gdk_cairo_create( impldc->GetGDKWindow() ) );
#elif defined __WXGTK20__
wxGTKDCImpl *impldc = (wxGTKDCImpl*) dc.GetImpl();
Init( gdk_cairo_create( impldc->GetGDKWindow() ) );
cairo_t* cr = NULL;
if (m_graphicContext)
cr = static_cast<cairo_t*>(m_graphicContext->GetNativeContext());
cairo_t* cr = NULL;
if (m_graphicContext)
cr = static_cast<cairo_t*>(m_graphicContext->GetNativeContext());
- if (cr)
- cairo_reference(cr);
return cr;
}
//-----------------------------------------------------------------------------
return cr;
}
//-----------------------------------------------------------------------------
void* wxGtkPrinterDCImpl::GetCairoContext() const
{
void* wxGtkPrinterDCImpl::GetCairoContext() const
{
- return (void*) cairo_reference( m_cairo );
}
void* wxGtkPrinterDCImpl::GetHandle() const
}
void* wxGtkPrinterDCImpl::GetHandle() const