diff options
author | Johannes Schickel | 2010-01-12 19:07:03 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-12 19:07:03 +0000 |
commit | 003c62fee8d89cc4a06ca3193f72e086fdee41a2 (patch) | |
tree | 3fabd5f87c084419dae03108f8f9e45b53721d1f /engines/sci | |
parent | c1e4156587675f0412fcabdf93b97c5a113258fc (diff) | |
download | scummvm-rg350-003c62fee8d89cc4a06ca3193f72e086fdee41a2.tar.gz scummvm-rg350-003c62fee8d89cc4a06ca3193f72e086fdee41a2.tar.bz2 scummvm-rg350-003c62fee8d89cc4a06ca3193f72e086fdee41a2.zip |
A null pointer can be safely passed to "delete", thus there is no need to check against the pointer being non-zero in advance.
svn-id: r47272
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/text.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/engines/sci/graphics/text.cpp b/engines/sci/graphics/text.cpp index a65bd36339..c5a6c5ced2 100644 --- a/engines/sci/graphics/text.cpp +++ b/engines/sci/graphics/text.cpp @@ -41,8 +41,7 @@ Text::Text(ResourceManager *resMan, Gfx *gfx, Screen *screen) } Text::~Text() { - if (_font != NULL) - delete _font; + delete _font; } void Text::init() { @@ -59,8 +58,7 @@ GuiResourceId Text::GetFontId() { Font *Text::GetFont() { if ((_font == NULL) || (_font->getResourceId() != _gfx->_curPort->fontId)) { - if (_font != NULL) - delete _font; + delete _font; _font = new Font(_resMan, _gfx->_curPort->fontId); } @@ -69,8 +67,7 @@ Font *Text::GetFont() { void Text::SetFont(GuiResourceId fontId) { if ((_font == NULL) || (_font->getResourceId() != fontId)) { - if (_font != NULL) - delete _font; + delete _font; _font = new Font(_resMan, fontId); } |