# HG changeset patch # User sheepluva # Date 1418057007 -3600 # Node ID efa069762cb202db0aa013e4753f8b6878556545 # Parent 992863acb2b78f16403c2c9cd627c6abb8b9dfc9 clean up fonts diff -r 992863acb2b7 -r efa069762cb2 hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Mon Dec 08 11:20:31 2014 -0500 +++ b/hedgewars/SDLh.pas Mon Dec 08 17:43:27 2014 +0100 @@ -1105,6 +1105,7 @@ function TTF_OpenFontRW(src: PSDL_RWops; freesrc: LongBool; size: LongInt): PTTF_Font; cdecl; external SDL_TTFLibName; procedure TTF_SetFontStyle(font: PTTF_Font; style: LongInt); cdecl; external SDL_TTFLibName; +procedure TTF_CloseFont(font: PTTF_Font); cdecl; external SDL_TTFLibName; (* SDL_mixer *) function Mix_Init(flags: LongInt): LongInt; {$IFDEF SDL_MIXER_NEWER}cdecl; external SDL_MixerLibName{$ELSE}inline{$ENDIF}; diff -r 992863acb2b7 -r efa069762cb2 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Mon Dec 08 11:20:31 2014 -0500 +++ b/hedgewars/uStore.pas Mon Dec 08 17:43:27 2014 +0100 @@ -1257,8 +1257,20 @@ end; procedure freeModule; +var fi: THWFont; begin StoreRelease(false); + // make sure fonts are cleaned up + for fi:= Low(THWFont) to High(THWFont) do + with Fontz[fi] do + begin + if Handle <> nil then + begin + TTF_CloseFont(Handle); + Handle:= nil; + end; + end; + TTF_Quit(); {$IFDEF SDL2} SDL_GL_DeleteContext(SDLGLcontext);