Krolyxon
Commit 0d8dcfd

Branches

Refs →

nsxiv0d8dcfd

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
Author
Sam Whitehead
Date
2021-09-16 21:27 +0100
Committer
GitHub · 2021-09-16 20:27 +0000
Parent
0b20783
Commit
0d8dcfd5210cbbf0e333cae4936f4828b8700d08

+2 −0

2 files changed

  1. M CHANGELOG.md +1 −0
  2. M window.c +1 −0
M CHANGELOG.md View
@@ -23,6 +23,7 @@ Fixes:
2323 * Wrong keybinding description in the manpage (#14)
2424 * .desktop entry not advertising webp support (#15)
2525 * Prevent crash when embedded into transparent window (#3)
26+ * Small memory leak (#57)
2627 * Rare crash when showing some GIFs (#41)
2728 * Rare event when nsxiv wouldn't close after window being destroyed (#53)
2829
M window.c View
@@ -61,6 +61,7 @@ void win_init_font(const win_env_t *e, const char *fontstr)
6161 fontheight = font->ascent + font->descent;
6262 FcPatternGetDouble(font->pattern, FC_SIZE, 0, &fontsize);
6363 barheight = fontheight + 2 * V_TEXT_PAD;
64+ XftFontClose(e->dpy, font);
6465 }
6566
6667 void win_alloc_color(const win_env_t *e, const char *name, XftColor *col)