]> Dogcows Code - chaz/openbox/commitdiff
allow freeing NULL pixmap masks
authorDana Jansens <danakj@orodu.net>
Sun, 13 Apr 2003 02:28:29 +0000 (02:28 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 13 Apr 2003 02:28:29 +0000 (02:28 +0000)
render/mask.c

index 26059ca6e581bb1c6696a9be976b546d5850eaa9..22cb3feeb96c5879b485503fbf07c545e7df80b6 100644 (file)
@@ -14,9 +14,11 @@ pixmap_mask *pixmap_mask_new(int w, int h, char *data)
 
 void pixmap_mask_free(pixmap_mask *m)
 {
-    XFreePixmap(ob_display, m->mask);
-    g_free(m->data);
-    g_free(m);
+    if (m) {
+        XFreePixmap(ob_display, m->mask);
+        g_free(m->data);
+        g_free(m);
+    }
 }
 
 void mask_draw(Pixmap p, TextureMask *m, Rect *position)
This page took 0.025413 seconds and 4 git commands to generate.