libsdl-org / SDL_ttf

Support for TrueType (.ttf) font files with Simple Directmedia Layer.
zlib License
402 stars 131 forks source link

Fix memory leak when destroying text #430

Closed MirkoCovizzi closed 1 week ago

MirkoCovizzi commented 1 week ago

The engine's DestroyText function is never called, as well as the frees for some internal components. This fixes memory leaks reported by some users.

MirkoCovizzi commented 1 week ago

Fixes: https://github.com/libsdl-org/SDL_ttf/pull/412#issuecomment-2448128287 (tested) Fixes: https://github.com/libsdl-org/SDL_ttf/issues/425 (tested, after fixing the main loop by adding SDL_PollEvent)

MirkoCovizzi commented 1 week ago

@captain0xff @bmrhoads Please let me know if this works for you

captain0xff commented 1 week ago

Yes, this fixes the leak on my end.

slouken commented 1 week ago

Merged, thanks!

bmrhoads commented 1 week ago

Yeah, it's working great thank you