dont fux self in color_free if the color is NULL
This commit is contained in:
parent
fd5784c082
commit
c2bb32dcd1
1 changed files with 6 additions and 4 deletions
|
@ -58,9 +58,11 @@ color_rgb *color_new(int r, int g, int b)
|
||||||
|
|
||||||
void color_free(color_rgb *c)
|
void color_free(color_rgb *c)
|
||||||
{
|
{
|
||||||
if (c->gc != None)
|
if (c != NULL) {
|
||||||
XFreeGC(ob_display, c->gc);
|
if (c->gc != None)
|
||||||
g_free(c);
|
XFreeGC(ob_display, c->gc);
|
||||||
|
g_free(c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void reduce_depth(pixel32 *data, XImage *im)
|
void reduce_depth(pixel32 *data, XImage *im)
|
||||||
|
@ -87,7 +89,7 @@ void reduce_depth(pixel32 *data, XImage *im)
|
||||||
data += im->width;
|
data += im->width;
|
||||||
p32 += im->width;
|
p32 += im->width;
|
||||||
}
|
}
|
||||||
} else im->data = data;
|
} else im->data = (char*) data;
|
||||||
break;
|
break;
|
||||||
case 16:
|
case 16:
|
||||||
for (y = 0; y < im->height; y++) {
|
for (y = 0; y < im->height; y++) {
|
||||||
|
|
Loading…
Reference in a new issue