-
Notifications
You must be signed in to change notification settings - Fork 796
Open
Description
I have noticed that the freetype fonts don't release their memory correctly.
The fix would be:
void fonsDeleteInternal(FONScontext* stash)
{
int i;
if (stash == NULL) return;
if (stash->params.renderDelete)
stash->params.renderDelete(stash->params.userPtr);
for (i = 0; i < stash->nfonts; ++i)
fons__tt_done_face(&stash->fonts[i]->font);
for (i = 0; i < stash->nfonts; ++i)
fons__freeFont(stash->fonts[i]);
if (stash->atlas) fons__deleteAtlas(stash->atlas);
if (stash->fonts) free(stash->fonts);
if (stash->texData) free(stash->texData);
if (stash->scratch) free(stash->scratch);
fons__tt_done(stash);
free(stash);
}
int fons__tt_done_face(FONSttFontImpl* font)
{
FT_Error ftError;
ftError = FT_Done_Face(font->font);
return ftError == 0;
}
mulle-nat and funlw65
Metadata
Metadata
Assignees
Labels
No labels