diff --git a/src/Font.cpp b/src/Font.cpp index a2f9824993..e0c3841bbc 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -741,8 +741,6 @@ void Font::Load( const RString &sIniPath, RString sChars ) { const RString &sTexturePath = asTexturePaths[i]; - FontPage *pPage = new FontPage; - // Grab the page name, eg "foo" from "Normal [foo].png". RString sPagename = GetPageNameFromFileName( sTexturePath ); @@ -750,6 +748,9 @@ void Font::Load( const RString &sIniPath, RString sChars ) if( sTexturePath.find("-stroke") != string::npos ) continue; + // Create this down here so it doesn't leak if the continue gets triggered. + FontPage *pPage = new FontPage; + // Load settings for this page from the INI. FontPageSettings cfg; LoadFontPageSettings( cfg, ini, sTexturePath, "common", sChars );