[SDL] please help, SDL ttf IS eating up all my memory =(

Bernhard Bliem bernhard.bliem at chello.at
Fri Apr 2 04:33:19 PST 2004


You should also not forget to call TTF_CloseFont(font);, 
TTF_Closefont(big_font); and TTF_Quit(); before you exit.

Daniel Hedrick wrote:
> Quoting Graveyard Filla <graveyardfilla at hotmail.com>:
> 
>>	if(size == 1)
>>		text = TTF_RenderText_Solid(font,message,color);
>>	else text = TTF_RenderText_Solid(font_big,message,color);
> 
> 
> See these docs:
> 
> http://jcatki.no-ip.org/SDL_ttf/SDL_ttf_28.html#SEC28
> 
> You never free the memory returned from TTF_RenderText_Solid,
> which returns a new surface every call. After your blit call
> 
> SDL_FreeSurface(text);
> 
> Good luck!
> 
> -daniel
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
> 




More information about the SDL mailing list