diff options
author | Filippos Karapetis | 2008-05-08 13:23:02 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-05-08 13:23:02 +0000 |
commit | a9b4058ba9fd94de7bd293b0763d71f9f90f84bc (patch) | |
tree | a7a31180e4707c803a399708f71ed4fdb7d8eeb6 /engines/made/scriptfuncs_mhne.cpp | |
parent | 4f108b76a3874a80e6c8a3b5c79c75d737e49ecb (diff) | |
download | scummvm-rg350-a9b4058ba9fd94de7bd293b0763d71f9f90f84bc.tar.gz scummvm-rg350-a9b4058ba9fd94de7bd293b0763d71f9f90f84bc.tar.bz2 scummvm-rg350-a9b4058ba9fd94de7bd293b0763d71f9f90f84bc.zip |
Fixed some game crashes which occurred when ProjectReader::purgeCache() got called:
- MIDI music data is marked to be deleted in o1_STOPMUS now, instead of o1_PLAYMUS.
- Added a FIXME to Screen::setFont() - purgeCache crashes the game if the active font is deleted
svn-id: r31948
Diffstat (limited to 'engines/made/scriptfuncs_mhne.cpp')
-rw-r--r-- | engines/made/scriptfuncs_mhne.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/made/scriptfuncs_mhne.cpp b/engines/made/scriptfuncs_mhne.cpp index 4c942edec2..748bce3918 100644 --- a/engines/made/scriptfuncs_mhne.cpp +++ b/engines/made/scriptfuncs_mhne.cpp @@ -233,15 +233,17 @@ int16 ScriptFunctionsMhne::o1_PLAYSND(int16 argc, int16 *argv) { int16 ScriptFunctionsMhne::o1_PLAYMUS(int16 argc, int16 *argv) { int16 musicNum = argv[0]; if (musicNum > 0) { - GenericResource *xmidi = _vm->_res->getXmidi(musicNum); - _vm->_music->playXMIDI(xmidi); - _vm->_res->freeResource(xmidi); + _xmidiRes = _vm->_res->getXmidi(musicNum); + _vm->_music->playXMIDI(_xmidiRes); } return 0; } int16 ScriptFunctionsMhne::o1_STOPMUS(int16 argc, int16 *argv) { - _vm->_music->stop(); + if (_vm->_music->isPlaying()) { + _vm->_music->stop(); + _vm->_res->freeResource(_xmidiRes); + } return 0; } |