]> git.saurik.com Git - wxWidgets.git/commitdiff
Restore pattern creation, and do sanity checks before destroying the pattern or the...
authorKevin Ollivier <kevino@theolliviers.com>
Mon, 24 Aug 2009 22:49:27 +0000 (22:49 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Mon, 24 Aug 2009 22:49:27 +0000 (22:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/graphicc.cpp

index 94b1247b22d04b0d2fc02d6d04f4b0f06563fa2b..d2a9ab089f0fdc4bd2d09af78b338dc42087aa05 100644 (file)
@@ -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;
 }