mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
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
This commit is contained in:
@@ -276,15 +276,17 @@ int16 ScriptFunctionsRtz::o1_PLAYSND(int16 argc, int16 *argv) {
|
||||
int16 ScriptFunctionsRtz::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 ScriptFunctionsRtz::o1_STOPMUS(int16 argc, int16 *argv) {
|
||||
_vm->_music->stop();
|
||||
if (_vm->_music->isPlaying()) {
|
||||
_vm->_music->stop();
|
||||
_vm->_res->freeResource(_xmidiRes);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user