Skip to content

Commit

Permalink
[LINUX] Properly close openned TTF fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Sep 30, 2024
1 parent 89f503f commit f72bac7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions StuntCarRacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,19 @@ void CreateFonts()
}
printf("Font created (%p / %p)\n", g_pFont, g_pFontLarge);
}
void CloseFonts()
{
if (g_pFont!=NULL)
{
TTF_CloseFont(g_pFont);
g_pFont = 0;
}
if (g_pFontLarge!=NULL)
{
TTF_CloseFont(g_pFontLarge);
g_pFontLarge = NULL;
}
}
void LoadTextures()
{
if (!g_pAtlas) g_pAtlas = new IDirect3DTexture9();
Expand Down Expand Up @@ -2297,6 +2310,8 @@ int main(int argc, const char** argv)
#endif
FreeData();

CloseFonts();

sound_destroy();
TTF_Quit();
SDL_Quit();
Expand Down

0 comments on commit f72bac7

Please sign in to comment.