diff options
author | Matthew Stewart | 2018-06-25 01:40:45 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-09 08:37:30 +0200 |
commit | aa41f89395b3fa3e74a4e060a06c1dbfd537c158 (patch) | |
tree | 119558123569a8eec8a1d5bdea1deeb995c748d2 | |
parent | c3bd0347ada48ab5188d058104c884f3a0d61c21 (diff) | |
download | scummvm-rg350-aa41f89395b3fa3e74a4e060a06c1dbfd537c158.tar.gz scummvm-rg350-aa41f89395b3fa3e74a4e060a06c1dbfd537c158.tar.bz2 scummvm-rg350-aa41f89395b3fa3e74a4e060a06c1dbfd537c158.zip |
STARTREK: Fix memory leak in drawAllSprites
-rw-r--r-- | engines/startrek/awaymission.cpp | 2 | ||||
-rw-r--r-- | engines/startrek/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/startrek/menu.cpp | 1 | ||||
-rw-r--r-- | engines/startrek/text.cpp | 2 |
4 files changed, 4 insertions, 3 deletions
diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp index ebdaa561ae..6d845dadde 100644 --- a/engines/startrek/awaymission.cpp +++ b/engines/startrek/awaymission.cpp @@ -705,7 +705,7 @@ void StarTrekEngine::checkTouchedLoadingZone(int16 x, int16 y) { /** * Updates any nonzero away mission timers, and invokes ACTION_TIMER_EXPIRED when any one - * reached 0. + * reaches 0. */ void StarTrekEngine::updateAwayMissionTimers() { for (int i = 0; i < 8; i++) { diff --git a/engines/startrek/graphics.cpp b/engines/startrek/graphics.cpp index f369c11dd0..9dc484f33a 100644 --- a/engines/startrek/graphics.cpp +++ b/engines/startrek/graphics.cpp @@ -542,6 +542,8 @@ void Graphics::drawAllSprites(bool updateScreen) { _vm->_system->copyRectToScreen((byte *)surface.getPixels() + offset, SCREEN_WIDTH, r.left, r.top, r.width(), r.height()); } + surface.free(); + if (updateScreen) { // Check if there are any pending updates to the mouse. if (_mouseBitmap != _mouseBitmapLastFrame) { diff --git a/engines/startrek/menu.cpp b/engines/startrek/menu.cpp index d71251810a..39f4c5af5b 100644 --- a/engines/startrek/menu.cpp +++ b/engines/startrek/menu.cpp @@ -418,7 +418,6 @@ exitMenu: case Common::KEYCODE_SPACE: case Common::KEYCODE_F2: // Exit menu without selecting anything goto exitMenu; - goto exitMenu; case Common::KEYCODE_RETURN: case Common::KEYCODE_KP_ENTER: diff --git a/engines/startrek/text.cpp b/engines/startrek/text.cpp index 64e5dc23f3..071dc6d49c 100644 --- a/engines/startrek/text.cpp +++ b/engines/startrek/text.cpp @@ -207,7 +207,7 @@ String StarTrekEngine::playTextAudio(const String &str) { /** * @param rclickCancelsChoice If true, right-clicks return "-1" as choice instead of - * whetever was selected. + * whatever was selected. */ int StarTrekEngine::showText(TextGetterFunc textGetter, uintptr var, int xoffset, int yoffset, int textColor, bool loopChoices, int maxTextLines, bool rclickCancelsChoice) { int16 tmpTextDisplayMode = _textDisplayMode; |