1. pygame
  2. Untitled project
  3. pygame

Commits

tanoku  committed 4603dc1

Prevent cache being destroyed without a FT instance.

  • Participants
  • Parent commits 5bd6b69
  • Branches pgreloaded

Comments (0)

Files changed (1)

File src/freetype/ft_wrap.c

View file
  • Ignore whitespace
 PGFT_UnloadFont(FreeTypeInstance *ft, PyFreeTypeFont *font)
 {
     if (ft != NULL)
+    {
         FTC_Manager_RemoveFaceID(ft->cache_manager, (FTC_FaceID)(&font->id));
+        if (PGFT_INTERNALS(font))
+            PGFT_Cache_Destroy(&PGFT_INTERNALS(font)->cache);
+    }
 
     if (PGFT_INTERNALS(font))
     {
-        PGFT_Cache_Destroy(&PGFT_INTERNALS(font)->cache);
         free(PGFT_INTERNALS(font)->active_text.glyphs);
         free(PGFT_INTERNALS(font));
     }