From 7a4d1b1a6e2fa64b46d2c5f38b4e8762d850867d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 30 Nov 2019 12:39:18 +0100 Subject: [PATCH] font: destructor: pop elements as we go Otherwise we'll end up free:ing the same font over and over again. --- font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font.c b/font.c index a21cf937..d7460e21 100644 --- a/font.c +++ b/font.c @@ -41,7 +41,7 @@ static void __attribute__((destructor)) fini(void) { while (tll_length(font_cache) > 0) - font_destroy(tll_front(font_cache).font); + font_destroy(tll_pop_front(font_cache).font); mtx_destroy(&ft_lock); FT_Done_FreeType(ft_lib);