diff options
Diffstat (limited to 'engines/sci/gui')
-rw-r--r-- | engines/sci/gui/gui_animate.cpp | 12 | ||||
-rw-r--r-- | engines/sci/gui/gui_text.cpp | 8 |
2 files changed, 6 insertions, 14 deletions
diff --git a/engines/sci/gui/gui_animate.cpp b/engines/sci/gui/gui_animate.cpp index f7e53fa196..16e67873aa 100644 --- a/engines/sci/gui/gui_animate.cpp +++ b/engines/sci/gui/gui_animate.cpp @@ -44,10 +44,8 @@ SciGuiAnimate::SciGuiAnimate(EngineState *state, SciGuiGfx *gfx, SciGuiScreen *s } SciGuiAnimate::~SciGuiAnimate() { - if (_listData) - free(_listData); - if (_lastCastData) - free(_lastCastData); + free(_listData); + free(_lastCastData); } void SciGuiAnimate::init() { @@ -129,15 +127,13 @@ void SciGuiAnimate::makeSortedList(List *list) { // Adjust list size, if needed if ((_listData == NULL) || (_listCount < listCount)) { - if (_listData) - free(_listData); + free(_listData); _listData = (GuiAnimateEntry *)malloc(listCount * sizeof(GuiAnimateEntry)); if (!_listData) error("Could not allocate memory for _listData"); _listCount = listCount; - if (_lastCastData) - free(_lastCastData); + free(_lastCastData); _lastCastData = (GuiAnimateEntry *)malloc(listCount * sizeof(GuiAnimateEntry)); if (!_lastCastData) error("Could not allocate memory for _lastCastData"); diff --git a/engines/sci/gui/gui_text.cpp b/engines/sci/gui/gui_text.cpp index 21e92f9617..218008a95e 100644 --- a/engines/sci/gui/gui_text.cpp +++ b/engines/sci/gui/gui_text.cpp @@ -74,9 +74,7 @@ void SciGuiText::SetFont(GuiResourceId fontId) { void SciGuiText::CodeSetFonts(int argc, reg_t *argv) { int i; - if (_codeFonts) { - delete _codeFonts; - } + delete _codeFonts; _codeFontsCount = argc; _codeFonts = new GuiResourceId[argc]; for (i = 0; i < argc; i++) { @@ -87,9 +85,7 @@ void SciGuiText::CodeSetFonts(int argc, reg_t *argv) { void SciGuiText::CodeSetColors(int argc, reg_t *argv) { int i; - if (_codeColors) { - delete _codeColors; - } + delete _codeColors; _codeColorsCount = argc; _codeColors = new uint16[argc]; for (i = 0; i < argc; i++) { |