Add some safeguards
This commit is contained in:
parent
4eb33dfc4f
commit
8e6f931f85
|
@ -97,11 +97,14 @@ static void wiiu_font_free_font(void* data, bool is_threaded)
|
|||
if (!font)
|
||||
return;
|
||||
|
||||
if (font->font_driver && font->font_data)
|
||||
if (font->font_driver && font->font_data &&
|
||||
font->font_driver->free)
|
||||
font->font_driver->free(font->font_data);
|
||||
|
||||
MEM1_free(font->texture.surface.image);
|
||||
MEM1_free(font->ubo_tex);
|
||||
if (font->texture.surface.image)
|
||||
MEM1_free(font->texture.surface.image);
|
||||
if (font->ubo_tex)
|
||||
MEM1_free(font->ubo_tex);
|
||||
free(font);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue