font: destructor: pop elements as we go

Otherwise we'll end up free:ing the same font over and over again.
This commit is contained in:
Daniel Eklöf 2019-11-30 12:39:18 +01:00
parent 4e1a6b5739
commit 7a4d1b1a6e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

2
font.c
View file

@ -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);