aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula/graphics.cpp
diff options
context:
space:
mode:
authorDavid Turner2011-01-28 08:07:50 +0000
committerDavid Turner2011-01-28 08:07:50 +0000
commit96174d6842fafe24afde9964e48967bc44b6badd (patch)
treede173dbe7f8e5b379d780d465c207e6d27dde6c4 /engines/drascula/graphics.cpp
parentf7e1ed37628973d5dc515fdf4e2ce27fbc3e1e26 (diff)
downloadscummvm-rg350-96174d6842fafe24afde9964e48967bc44b6badd.tar.gz
scummvm-rg350-96174d6842fafe24afde9964e48967bc44b6badd.tar.bz2
scummvm-rg350-96174d6842fafe24afde9964e48967bc44b6badd.zip
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
Diffstat (limited to 'engines/drascula/graphics.cpp')
-rw-r--r--engines/drascula/graphics.cpp6
1 files changed, 2 insertions, 4 deletions
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