Re : SDL and TTF freeing problems?

Yes, I think it’s a good solution. Just make a simple memory pool object keeping a list of pointers to allocated zones
and free the memory pool once at the end of the application (or whenever you don’t need the objects it contains

Don’t forget to reference your objects inside the memory pool when you allocate them.


----- Message d’origine ----De : Mason Wheeler
? : A list for developers using the SDL library. (includes SDL-announce)
Envoy? le : Mercredi, 16 Juillet 2008, 16h43mn 33s
Objet : Re: [SDL] SDL and TTF freeing problems?

If the problem’s with the font structs themselves, then the solution is simple. Just don’t have the object take ownership of them. Don’t free them in the objects’ destructor; keep track of them separately and free them when whatever routine originally allocated them terminates.

----- Original Message ----
From: Creature
Subject: Re: [SDL] SDL and TTF freeing problems?

Yes, that seems to work, thanks.

Anyone have any idea’s on the TTF_Font * problem though? Unlike SDL_Surfaces,
TTF_Font doesn’t have a refcount, but the surfaces generated by the font do

SDL mailing list
SDL at


Envoyez avec Yahoo! Mail. Une boite mail plus intelligente