diff options
author | Matthieu Herrb <matthieu@herrb.eu> | 2024-08-02 09:03:40 +0200 |
---|---|---|
committer | Matthieu Herrb <matthieu@herrb.eu> | 2024-08-02 09:03:40 +0200 |
commit | e7da3828207713d529a10e093a40d5abba1c0220 (patch) | |
tree | 7320ad1a7c7e891c00827e9b2867a1e0fbc2d536 /src/util.c | |
parent | e8fc1baf5ad574a01b65e3a3ec415f212f326550 (diff) | |
parent | 64edeaaa4c7492d090b4069de2eae5f411ff1cd4 (diff) |
Merge remote-tracking branch 'origin/master' into obsdobsd
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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) { |