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,9 +68,11 @@ ObFont *font_open(char *fontstring)
void font_close(ObFont *f) void font_close(ObFont *f)
{ {
if (f) {
XftFontClose(ob_display, f->xftfont); XftFontClose(ob_display, f->xftfont);
g_free(f); g_free(f);
} }
}
int font_measure_string(ObFont *f, char *str, int shadow, int offset) int font_measure_string(ObFont *f, char *str, int shadow, int offset)
{ {