2
0
Эх сурвалжийг харах

Fixes memory leak in text.c

GenImageFontAtlas() allocates an array of stbrp_rect for the packing functions, but it never frees them.
noshbar 7 жил өмнө
parent
commit
ec6b21bd91
1 өөрчлөгдсөн 1 нэмэгдсэн , 0 устгасан
  1. 1 0
      src/text.c

+ 1 - 0
src/text.c

@@ -527,6 +527,7 @@ Image GenImageFontAtlas(CharInfo *chars, int charsCount, int fontSize, int paddi
             else TraceLog(LOG_WARNING, "Character could not be packed: %i", i);
             else TraceLog(LOG_WARNING, "Character could not be packed: %i", i);
         }
         }
 
 
+        free(rects);
         free(nodes);
         free(nodes);
         free(context);
         free(context);
     }
     }