Try to avoid crashing in wxGTK wxCairoContext ctor.
Don't use an uninitialized pointer in wxCairoContext ctor from wxPrinterDC in wxGTK if retrieving Cairo context of the DC failed, set m_context to NULL in this case (not sure if this is still not going to crash when used in cairo_translate() below though).
This commit is contained in:
@@ -1680,6 +1680,8 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxPrinterDC&
|
|||||||
cairo_t* cr = static_cast<cairo_t*>(impl->GetCairoContext());
|
cairo_t* cr = static_cast<cairo_t*>(impl->GetCairoContext());
|
||||||
if (cr)
|
if (cr)
|
||||||
Init(cairo_reference(cr));
|
Init(cairo_reference(cr));
|
||||||
|
else
|
||||||
|
m_context = NULL;
|
||||||
#endif
|
#endif
|
||||||
wxSize sz = dc.GetSize();
|
wxSize sz = dc.GetSize();
|
||||||
m_width = sz.x;
|
m_width = sz.x;
|
||||||
|
Reference in New Issue
Block a user