From: Kevin Ollivier Date: Mon, 24 Aug 2009 22:49:27 +0000 (+0000) Subject: Restore pattern creation, and do sanity checks before destroying the pattern or the... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/66f917a7eaf5d9c90fe76f7bbefeba2dd30a7de3?ds=sidebyside Restore pattern creation, and do sanity checks before destroying the pattern or the surface. Closes #11140. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index 94b1247b22..d2a9ab089f 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -1084,12 +1084,17 @@ wxCairoBitmapData::wxCairoBitmapData( wxGraphicsRenderer* renderer, const wxBitm p.OffsetY(pixData, 1); } } + m_pattern = cairo_pattern_create_for_surface(m_surface); } wxCairoBitmapData::~wxCairoBitmapData() { - cairo_pattern_destroy(m_pattern); - cairo_surface_destroy(m_surface); + if (m_pattern) + cairo_pattern_destroy(m_pattern); + + if (m_surface) + cairo_surface_destroy(m_surface); + delete [] m_buffer; }