summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 9a04ac1..52f6148 100644
--- a/src/util.c
+++ b/src/util.c
@@ -607,6 +607,7 @@ FindFontSet(MyFont *font, const char *fontname)
twmVerbose("font for charset %s is lacking.",
missing_charset_list_return[i]);
}
+ XFreeStringList(missing_charset_list_return);
}
font_extents = XExtentsOfFontSet(font->fontset);
@@ -672,6 +673,24 @@ GetFont(MyFont *font)
}
}
+void
+DestroyFont(MyFont *font)
+{
+ if (!font) {
+ return;
+ }
+
+ if (font->fontset) {
+ XFreeFontSet(dpy, font->fontset);
+ font->fontset = NULL;
+ }
+
+ if (font->font) {
+ XFreeFont(dpy, font->font);
+ font->font = NULL;
+ }
+}
+
int
MyFont_TextWidth(MyFont *font, const char *string, int len)
{