allow freeing NULL pixmap masks
This commit is contained in:
parent
c2bb32dcd1
commit
2d9c03a441
1 changed files with 5 additions and 3 deletions
|
@ -14,9 +14,11 @@ pixmap_mask *pixmap_mask_new(int w, int h, char *data)
|
||||||
|
|
||||||
void pixmap_mask_free(pixmap_mask *m)
|
void pixmap_mask_free(pixmap_mask *m)
|
||||||
{
|
{
|
||||||
XFreePixmap(ob_display, m->mask);
|
if (m) {
|
||||||
g_free(m->data);
|
XFreePixmap(ob_display, m->mask);
|
||||||
g_free(m);
|
g_free(m->data);
|
||||||
|
g_free(m);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mask_draw(Pixmap p, TextureMask *m, Rect *position)
|
void mask_draw(Pixmap p, TextureMask *m, Rect *position)
|
||||||
|
|
Loading…
Reference in a new issue