From 96174d6842fafe24afde9964e48967bc44b6badd Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 28 Jan 2011 08:07:50 +0000 Subject: DRASCULA: Fixed Code to allow Quit/RTL Function and avoid Memory Leakage. A memory leakage was traced down to a failure to call the engine destructor. This was due to the engine directly calling OSystem quit() i.e. _system->quit(), rather than just allowing engine::run() to return. Have removed this code and implemented the changes required to allow graceful Quit/RTL to occur. svn-id: r55583 --- engines/drascula/graphics.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/drascula/graphics.cpp') diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 70085b99af..9c5f3dc12a 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -417,7 +417,7 @@ void DrasculaEngine::screenSaver() { xr = mouseX; yr = mouseY; - for (;;) { + while (!shouldQuit()) { // efecto(bgSurface); memcpy(copia, bgSurface, 64000); @@ -497,7 +497,7 @@ void DrasculaEngine::playFLI(const char *filefli, int vel) { Common::SeekableReadStream *stream = _archives.open(filefli); LastFrame = _system->getMillis(); - while (playFrameSSN(stream) && (!term_int)) { + while (playFrameSSN(stream) && (!term_int) && !shouldQuit()) { if (getScan() == Common::KEYCODE_ESCAPE) term_int = 1; } @@ -651,6 +651,4 @@ bool DrasculaEngine::animate(const char *animationFile, int FPS) { return ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)); } - - } // End of namespace Drascula -- cgit v1.2.3