Free the data of each font attachment in Font_UnloadFont
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 12 Nov 2010 18:40:44 +0000 (18:40 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 12 Nov 2010 18:40:44 +0000 (18:40 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10587 d7cf8633-e32d-0410-b094-e92efae38249

ft2.c

diff --git a/ft2.c b/ft2.c
index 9f7c368..f5efcab 100644 (file)
--- a/ft2.c
+++ b/ft2.c
@@ -957,6 +957,10 @@ void Font_UnloadFont(ft2_font_t *font)
        int i;
        if (font->attachments && font->attachmentcount)
        {
+               for (i = 0; i < font->attachmentcount; ++i) {
+                       if (font->attachments[i].data)
+                               Mem_Free(font->attachments[i].data);
+               }
                Mem_Free(font->attachments);
                font->attachmentcount = 0;
                font->attachments = NULL;