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:
Filippos Karapetis
2008-05-08 13:23:02 +00:00
parent 4f108b76a3
commit a9b4058ba9
5 changed files with 25 additions and 15 deletions
+4 -2
View File
@@ -599,8 +599,10 @@ void Screen::flash(int flashCount) {
void Screen::setFont(int16 fontNum) {
if (fontNum == _currentFontNum)
return;
if (_font)
_vm->_res->freeResource(_font);
// FIXME: this causes crashes when
// ProjectReader::purgeCache() is called
//if (_font)
// _vm->_res->freeResource(_font);
_font = _vm->_res->getFont(fontNum);
_currentFontNum = fontNum;
}