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
+2 −0
2 files changed
- M CHANGELOG.md +1 −0
- M window.c +1 −0
| @@ -23,6 +23,7 @@ Fixes: | |||
| 23 | 23 | * Wrong keybinding description in the manpage (#14) | |
| 24 | 24 | * .desktop entry not advertising webp support (#15) | |
| 25 | 25 | * Prevent crash when embedded into transparent window (#3) | |
| 26 | + | * Small memory leak (#57) | |
| 26 | 27 | * Rare crash when showing some GIFs (#41) | |
| 27 | 28 | * Rare event when nsxiv wouldn't close after window being destroyed (#53) | |
| 28 | 29 | ||
| @@ -61,6 +61,7 @@ void win_init_font(const win_env_t *e, const char *fontstr) | |||
| 61 | 61 | fontheight = font->ascent + font->descent; | |
| 62 | 62 | FcPatternGetDouble(font->pattern, FC_SIZE, 0, &fontsize); | |
| 63 | 63 | barheight = fontheight + 2 * V_TEXT_PAD; | |
| 64 | + | XftFontClose(e->dpy, font); | |
| 64 | 65 | } | |
| 65 | 66 | ||
| 66 | 67 | void win_alloc_color(const win_env_t *e, const char *name, XftColor *col) | |