Memory leak in SDL_ttf 2.0.9?

Hello,

I’m using SDL_ttf for displaying Text in an application, however the
following line of code seems to clutter up the memory:

TTF_RenderText_Solid(font, “bla”, color);

Since I’m using this in a loop to render constantly changing texts, the
memory fills up quite quickly.
When I comment out this particular line, the memory usage stays constant.
(It actually looks different in the real code of course, but I tested it
with exactly that line).

Any hints?

Thanks

Hey,

try this:

http://jcatki.no-ip.org:8080/SDL_ttf/SDL_ttf_36.html

Assign it to an SDL_Surface pointer, and free after blitting, just like in the example.

Pat> ----- Original Message -----

From: Pascal Lingnau
To: sdl at lists.libsdl.org
Sent: Monday, June 15, 2009 7:20:30 PM
Subject: [SDL] Memory leak in SDL_ttf 2.0.9?

Hello,

I’m using SDL_ttf for displaying Text in an application, however the
following line of code seems to clutter up the memory:

TTF_RenderText_Solid(font, “bla”, color);

Since I’m using this in a loop to render constantly changing texts, the
memory fills up quite quickly.
When I comment out this particular line, the memory usage stays constant.
(It actually looks different in the real code of course, but I tested it
with exactly that line).

Any hints?

Thanks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org