diff options
-rw-r--r-- | engines/draci/font.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp index 5ea46ddb17..a99dd06a58 100644 --- a/engines/draci/font.cpp +++ b/engines/draci/font.cpp @@ -59,10 +59,8 @@ DraciFont::~DraciFont() { bool DraciFont::setFont(Common::String &filename) { - // If there is a font already loaded, free it - if (_charData) { - freeFont(); - } + // Free previously loaded font (if any) + freeFont(); Common::File f; @@ -98,8 +96,11 @@ bool DraciFont::setFont(Common::String &filename) { } void DraciFont::freeFont() { - delete[] _charWidths; - delete[] _charData; + // If there is a font already loaded, free it + if (_charData) { + delete[] _charWidths; + delete[] _charData; + } } uint8 DraciFont::getCharWidth(uint8 chr) const { |