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:
parent
d07c4cb826
commit
b6e5a0a679
@ -1680,6 +1680,8 @@ wxCairoContext::wxCairoContext( wxGraphicsRenderer* renderer, const wxPrinterDC&
|
||||
cairo_t* cr = static_cast<cairo_t*>(impl->GetCairoContext());
|
||||
if (cr)
|
||||
Init(cairo_reference(cr));
|
||||
else
|
||||
m_context = NULL;
|
||||
#endif
|
||||
wxSize sz = dc.GetSize();
|
||||
m_width = sz.x;
|
||||
|
Loading…
Reference in New Issue
Block a user