Fonts: fixed memory leaks, shutting down font loader, and on AddFont() failure in FreeType backend.

This commit is contained in:
ocornut
2025-03-11 11:46:18 +01:00
committed by ocornut
parent 52a6863771
commit 144f444217
3 changed files with 13 additions and 8 deletions

View File

@@ -416,7 +416,11 @@ bool ImGui_ImplFreeType_FontSrcInit(ImFontAtlas* atlas, ImFontConfig* src)
src->FontLoaderData = bd_font_data;
if (!bd_font_data->InitFont(bd->Library, src, atlas->FontBuilderFlags))
{
IM_DELETE(bd_font_data);
src->FontLoaderData = NULL;
return false;
}
return true;
}