mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-04 01:40:21 -05:00
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:
parent
4e1a6b5739
commit
7a4d1b1a6e
1 changed files with 1 additions and 1 deletions
2
font.c
2
font.c
|
|
@ -41,7 +41,7 @@ static void __attribute__((destructor))
|
||||||
fini(void)
|
fini(void)
|
||||||
{
|
{
|
||||||
while (tll_length(font_cache) > 0)
|
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);
|
mtx_destroy(&ft_lock);
|
||||||
FT_Done_FreeType(ft_lib);
|
FT_Done_FreeType(ft_lib);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue