Files
0ad/source/graphics
trompetin17 c8c1522953 Fix memory leak from Font
FreeType’s FT_Glyph_To_Bitmap mutates the FT_Glyph by allocating a new
glyph object and overwriting the input pointer. This creates a risk of
memory leaks if the old glyph isn’t released or if ownership is unclear.

To avoid this, we now store the glyph in a UniqueFTGlyph and explicitly
pass it by reference to FT_Glyph_To_Bitmap. After the mutation,
ownership continues to reside in the smart pointer, and cleanup is
guaranteed even in error branches.

For temporary glyphs (e.g., strokes), we still manually call
FT_Done_Glyph, since they are not managed by UniqueFTGlyph. These
changes ensure all glyph memory is correctly released and reduce the
need for repetitive error-path cleanup code.
2025-05-22 11:35:12 -05:00
..
2024-11-25 21:23:05 +01:00
2025-05-22 11:35:12 -05:00
2025-05-22 11:35:12 -05:00
2025-05-18 18:41:25 +02:00
2025-05-16 14:57:59 -05:00
2024-12-10 11:29:48 +01:00