Add missing function to free FontRenderer

This commit is contained in:
Francesco Abbate 2020-06-01 14:42:57 +02:00
parent 0389bd000a
commit 91a82d8ae4
3 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,11 @@ FontRenderer *FontRendererNew(unsigned int flags) {
return (FontRenderer *) font_renderer;
}
void FontRendererFree(FontRenderer *fr_) {
font_renderer_alpha *font_renderer = (font_renderer_alpha *) fr_;
delete font_renderer;
}
int FontRendererLoadFont(FontRenderer *fr_, const char *filename) {
font_renderer_alpha *font_renderer = (font_renderer_alpha *) fr_;
bool success = font_renderer->load_font(filename);

View File

@ -21,6 +21,7 @@ enum {
};
FontRenderer *FontRendererNew(unsigned int flags);
void FontRendererFree(FontRenderer *);
int FontRendererLoadFont(FontRenderer *, const char *filename);
int FontRendererGetFontHeight(FontRenderer *, float size);
int FontRendererBakeFontBitmap(FontRenderer *, int font_height,

View File

@ -212,6 +212,7 @@ void ren_free_font(RenFont *font) {
}
}
free(font->data);
FontRendererFree(font->renderer);
free(font);
}