Fix potential leak in Font

This commit is contained in:
Shenjoku
2013-04-29 16:29:55 -04:00
parent feb919f0bf
commit aac47c9777
+3 -2
View File
@@ -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 );