allow closing NULL fonts

This commit is contained in:
Dana Jansens 2003-04-13 02:29:09 +00:00
parent 2d9c03a441
commit ef1f7b0494

View file

@ -68,8 +68,10 @@ ObFont *font_open(char *fontstring)
void font_close(ObFont *f)
{
XftFontClose(ob_display, f->xftfont);
g_free(f);
if (f) {
XftFontClose(ob_display, f->xftfont);
g_free(f);
}
}
int font_measure_string(ObFont *f, char *str, int shadow, int offset)