Alexander Sabourenkov lxnt at caravan.ru
Tue Sep 3 10:00:01 PDT 2002


Nicolai Haehnle wrote:
> Hash: SHA1

[ ... ]

> - From a design POV I think it would be better to use TTF_initialized as a 
> counter of how often TTF_Init() has been called, then only shutting down 
> when the counter reaches 0 again.
> This way, you'll have to remember whether TTF was init when you started up 
> so you'll know whether to call the Quit function or not.

SCNR, but what if someone's code calls it too much and the variable overflows?
I know, I know 2^31 is quite a lot, but all it takes is one messed-up condition
in while().

 From code consistency POV it would be much better if TTF_Init() on initialized library
as well as TTF_Quit on uninitialized crashed the program on the spot.

This would help design one's program more sanely too.



More information about the SDL mailing list