STARTREK: Fix memory leak in drawAllSprites

This commit is contained in:
Matthew Stewart 2018-06-25 01:40:45 -04:00 committed by Eugene Sandulenko
parent c3bd0347ad
commit aa41f89395
4 changed files with 4 additions and 3 deletions

View File

@ -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++) {

View File

@ -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) {

View File

@ -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:

View File

@ -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;