LAB: Add a couple of safeguards

This commit is contained in:
Strangerke 2015-12-22 00:12:12 +01:00 committed by Willem Jan Palenstijn
parent e88d09d2ec
commit 26c48305b5
2 changed files with 5 additions and 0 deletions

View File

@ -158,6 +158,9 @@ bool Resource::readViews(uint16 roomNum) {
}
void Resource::freeViews(uint16 roomNum) {
if (!_vm->_rooms)
return;
for (uint16 i = 0; i < 4; i++)
freeView(_vm->_rooms[roomNum]._view[i]);

View File

@ -284,6 +284,8 @@ void LabEngine::doJournal() {
delete[] _blankJournal;
delete[] _journalBackImage->_imageData;
_blankJournal = _journalBackImage->_imageData = nullptr;
_event->freeButtonList(&_journalButtonList);
_graphics->closeFont(&_journalFont);