Scope perhaps?
if( TTF_Init() < 0 )
{
return 1;
}
{
Font thing;
}
TTF_Quit();
Or call another function.
void foo ( ) {
Font thing;
}
int main ( ) {
if( TTF_Init() < 0 )
{
return 1;
}
foo();
TTF_Quit();
}
Basically, it's just forcing the destructor to be called before Quit.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Apparently, calling TTF_Quit before TTF_CloseFont will cause the error. Is there any easy way around this?
You might also consider using atexit()
mitrmkar
Posting Virtuoso
1,809 posts since Nov 2007
Reputation Points: 1,105
Solved Threads: 395