diff options
author | Robert Göffringmann | 2003-07-06 21:33:22 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-07-06 21:33:22 +0000 |
commit | 2061741bd5112e1fbb05c203d45737cbd7d00d80 (patch) | |
tree | d982f2e0f059de63538828a08101c968445238a2 /sky | |
parent | 8d4fea8c6d052f9f37f7d43c2db8b091a280936e (diff) | |
download | scummvm-rg350-2061741bd5112e1fbb05c203d45737cbd7d00d80.tar.gz scummvm-rg350-2061741bd5112e1fbb05c203d45737cbd7d00d80.tar.bz2 scummvm-rg350-2061741bd5112e1fbb05c203d45737cbd7d00d80.zip |
fix bug #766744 (BASS: Crash when quitting while quitting)
svn-id: r8817
Diffstat (limited to 'sky')
-rw-r--r-- | sky/control.cpp | 6 | ||||
-rw-r--r-- | sky/sky.cpp | 5 | ||||
-rw-r--r-- | sky/sky.h | 1 |
3 files changed, 7 insertions, 5 deletions
diff --git a/sky/control.cpp b/sky/control.cpp index 42b5815c25..a753d77153 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -1450,9 +1450,8 @@ void SkyControl::delay(unsigned int amount) { break; case OSystem::EVENT_QUIT: - showGameQuitMsg(false); - delay(1500); - _system->quit(); + if (!SkyState::_systemVars.quitting) + showGameQuitMsg(false); break; default: @@ -1472,6 +1471,7 @@ void SkyControl::delay(unsigned int amount) { void SkyControl::showGameQuitMsg(bool useScreen) { + SkyState::_systemVars.quitting = true; uint8 *textBuf1 = (uint8*)malloc(GAME_SCREEN_WIDTH * 14 + sizeof(dataFileHeader)); uint8 *textBuf2 = (uint8*)malloc(GAME_SCREEN_WIDTH * 14 + sizeof(dataFileHeader)); uint8 textNum; diff --git a/sky/sky.cpp b/sky/sky.cpp index 77a5408b6a..35ec77a9c0 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -71,7 +71,7 @@ Engine *Engine_SKY_create(GameDetector *detector, OSystem *syst) { void **SkyState::_itemList[300]; -SystemVars SkyState::_systemVars = {0, 0, 0, 0, 4316, 0, false}; +SystemVars SkyState::_systemVars = {0, 0, 0, 0, 4316, 0, false, false }; SkyState::SkyState(GameDetector *detector, OSystem *syst) : Engine(detector, syst) { @@ -332,7 +332,8 @@ void SkyState::delay(uint amount) { //copied and mutilated from Simon.cpp break; case OSystem::EVENT_QUIT: - _skyControl->showGameQuitMsg(); // will call _system->quit() + if (!SkyState::_systemVars.quitting) + _skyControl->showGameQuitMsg(); // will call _system->quit() break; default: @@ -48,6 +48,7 @@ struct SystemVars { uint32 currentPalette; uint16 gameSpeed; bool pastIntro; + bool quitting; }; class SkyLogic; |