[SDL] TTF_RenderText functions increasing memory usage

Joshua Oreman oremanj at gmail.com
Fri Nov 4 20:47:53 PST 2005


On 11/4/05, Nick Stovall <nsto135 at aol.com> wrote:
> Hi. I'm writing a base engine class in SDL, using the TTF and mixer libraries.
> I'm just about done - there are a few bugs but overall it's ready to be used.
>
> One of the bugs deals with the TTF_RenderText functions - whenever they're run,
> they increase the amount of RAM that my program is using. This is a problem, as
> I've sat there and watched my program go from about 8.5 megs of RAM to 50MB in
> about 2 minutes. I KNOW it's these functions because if I comment them out and
> run the program, the RAM usage stays at a steady 8.5MB
>
> My questions are:
>
> 1) Has anyone else had this problem, and if so, how did you fix it?
> 3) Do you have any suggestions as to what might be causing this?

You need to free the surface returned from TTF_RenderText() with
SDL_FreeSurface().  Are you doing that?

-- Josh


>
> thanks.
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>




More information about the SDL mailing list