summaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authorSam Whitehead <sam.everythingcomputers@gmail.com>2021-09-16 22:27:03 +0200
committerGitHub <noreply@github.com>2021-09-16 22:27:03 +0200
commit0d8dcfd5210cbbf0e333cae4936f4828b8700d08 (patch)
tree99002aaf7e89ad22b0c0e3c942447b0a441365cd /window.c
parent0b2078316405af6b96a174628004f828f8fb8092 (diff)
downloadnsxiv-0d8dcfd5210cbbf0e333cae4936f4828b8700d08.tar.zst
Fix font memory leak. (#57)
* Fix font memory leak. This memory leak has always been present in sxiv. The font opened on window.c:58 was never closed, so I closed it, fixing a 2kB memory leak. * document changes Co-authored-by: NRK <nrk@disroot.org>
Diffstat (limited to 'window.c')
-rw-r--r--window.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/window.c b/window.c
index d05bef7..b36e61b 100644
--- a/window.c
+++ b/window.c
@@ -61,6 +61,7 @@ void win_init_font(const win_env_t *e, const char *fontstr)
fontheight = font->ascent + font->descent;
FcPatternGetDouble(font->pattern, FC_SIZE, 0, &fontsize);
barheight = fontheight + 2 * V_TEXT_PAD;
+ XftFontClose(e->dpy, font);
}
void win_alloc_color(const win_env_t *e, const char *name, XftColor *col)