Fix potential leak in Font
This commit is contained in:
+3
-2
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user