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 bae9269..e25206a 100644
--- a/src/util.c
+++ b/src/util.c
@@ -602,6 +602,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);
@@ -667,6 +668,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)
{