Fix some memory leaks

This commit is contained in:
Thomas Bernard
2018-02-10 18:23:08 +01:00
parent 61a1c6e39e
commit 48a8a79746
3 changed files with 31 additions and 1 deletions

View File

@@ -383,6 +383,22 @@ int TrueType_is_supported()
#endif
}
void Uninit_text(void)
{
#ifndef NOTTF
TTF_Quit();
#if defined(USE_FC)
FcFini();
#endif
#endif
while (font_list_start != NULL)
{
T_Font * font = font_list_start->Next;
free(font_list_start->Name);
free(font_list_start);
font_list_start = font;
}
}
#ifndef NOTTF
byte *Render_text_TTF(const char *str, int font_number, int size, int antialias, int bold, int italic, int *width, int *height, T_Palette palette)