From 39bed921aae4d86a23d0d1a869a1967662083650 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 13 Oct 2002 22:58:31 +0000 Subject: [PATCH] Unload font if loading a new one (fixes harmless "leak" of credits fonts) --- stepmania/src/BitmapText.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stepmania/src/BitmapText.cpp b/stepmania/src/BitmapText.cpp index 03ed281131..f77724498d 100644 --- a/stepmania/src/BitmapText.cpp +++ b/stepmania/src/BitmapText.cpp @@ -77,6 +77,11 @@ bool BitmapText::LoadFromFont( CString sFontFilePath ) { LOG->Trace( "BitmapText::LoadFromFontName(%s)", sFontFilePath ); + if( m_pFont ) { + FONT->UnloadFont( m_pFont->m_sTexturePath ); + m_pFont = NULL; + } + // load font m_pFont = FONT->LoadFont( sFontFilePath );