aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
authorStrangerke2014-03-05 08:16:49 +0100
committerStrangerke2014-03-05 08:16:49 +0100
commitbc8486a76b7347d9342bc057708d45ab549461ae (patch)
tree605289b311cd19fa881680051a14b21c83b57c80 /engines/voyeur
parentafb785e5c1d753d7f16ce110475cfd73f1019290 (diff)
downloadscummvm-rg350-bc8486a76b7347d9342bc057708d45ab549461ae.tar.gz
scummvm-rg350-bc8486a76b7347d9342bc057708d45ab549461ae.tar.bz2
scummvm-rg350-bc8486a76b7347d9342bc057708d45ab549461ae.zip
VOYEUR: Fix memory leak when quitting in showTitleScreen()
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/voyeur.cpp59
1 files changed, 32 insertions, 27 deletions
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index b4c9fbea65..0406ba089a 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -381,41 +381,46 @@ bool VoyeurEngine::doLock() {
}
void VoyeurEngine::showTitleScreen() {
- if (_bVoy->getBoltGroup(0x500)) {
- _graphicsManager->_backgroundPage = _bVoy->getPictureResource(0x500);
-
- (*_graphicsManager->_vPort)->setupViewPort();
- flipPageAndWait();
-
- // Immediate palette load to show the initial screen
- CMapResource *cMap = _bVoy->getCMapResource(0x501);
- assert(cMap);
- cMap->_steps = 60;
- cMap->startFade();
+ if (!_bVoy->getBoltGroup(0x500))
+ return;
- // Wait briefly
- _eventsManager->delayClick(200);
- if (shouldQuit())
- return;
+ _graphicsManager->_backgroundPage = _bVoy->getPictureResource(0x500);
- // Fade out the screen
- cMap = _bVoy->getCMapResource(0x504);
- cMap->_steps = 30;
- cMap->startFade();
+ (*_graphicsManager->_vPort)->setupViewPort();
+ flipPageAndWait();
- flipPageAndWaitForFade();
- if (shouldQuit())
- return;
+ // Immediate palette load to show the initial screen
+ CMapResource *cMap = _bVoy->getCMapResource(0x501);
+ assert(cMap);
+ cMap->_steps = 60;
+ cMap->startFade();
- _graphicsManager->screenReset();
- _eventsManager->delayClick(200);
+ // Wait briefly
+ _eventsManager->delayClick(200);
+ if (shouldQuit()) {
+ _bVoy->freeBoltGroup(0x500);
+ return;
+ }
- // Voyeur title
- playRL2Video("a1100100.rl2");
- _graphicsManager->screenReset();
+ // Fade out the screen
+ cMap = _bVoy->getCMapResource(0x504);
+ cMap->_steps = 30;
+ cMap->startFade();
+ flipPageAndWaitForFade();
+ if (shouldQuit()) {
_bVoy->freeBoltGroup(0x500);
+ return;
}
+
+ _graphicsManager->screenReset();
+ _eventsManager->delayClick(200);
+
+ // Voyeur title
+ playRL2Video("a1100100.rl2");
+ _graphicsManager->screenReset();
+
+ _bVoy->freeBoltGroup(0x500);
}
void VoyeurEngine::doOpening() {