I've been getting an "Access Violation" error while running this program:
#include "SDL/SDL_ttf.h"
class Font
{
private:
TTF_Font *font;
public:
Font()
{
font = TTF_OpenFont( "c:\\windows\\fonts\\cour.ttf", 20 );
}
~Font()
{
TTF_CloseFont( font ); //Access violation
}
};
int main( int argc, char *args[] )
{
if( TTF_Init() < 0 )
{
return 1;
}
Font thing;
TTF_Quit();
return 0;
}
Apparently, calling TTF_Quit before TTF_CloseFont will cause the error. Is there any easy way around this?