mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 17:57:14 +00:00
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
This commit is contained in:
parent
c1e4156587
commit
003c62fee8
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user