LAB: Add a couple of safeguards
This commit is contained in:
parent
e88d09d2ec
commit
26c48305b5
2 changed files with 5 additions and 0 deletions
|
@ -158,6 +158,9 @@ bool Resource::readViews(uint16 roomNum) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Resource::freeViews(uint16 roomNum) {
|
void Resource::freeViews(uint16 roomNum) {
|
||||||
|
if (!_vm->_rooms)
|
||||||
|
return;
|
||||||
|
|
||||||
for (uint16 i = 0; i < 4; i++)
|
for (uint16 i = 0; i < 4; i++)
|
||||||
freeView(_vm->_rooms[roomNum]._view[i]);
|
freeView(_vm->_rooms[roomNum]._view[i]);
|
||||||
|
|
||||||
|
|
|
@ -284,6 +284,8 @@ void LabEngine::doJournal() {
|
||||||
|
|
||||||
delete[] _blankJournal;
|
delete[] _blankJournal;
|
||||||
delete[] _journalBackImage->_imageData;
|
delete[] _journalBackImage->_imageData;
|
||||||
|
_blankJournal = _journalBackImage->_imageData = nullptr;
|
||||||
|
|
||||||
_event->freeButtonList(&_journalButtonList);
|
_event->freeButtonList(&_journalButtonList);
|
||||||
_graphics->closeFont(&_journalFont);
|
_graphics->closeFont(&_journalFont);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue