diff options
Diffstat (limited to 'engines/gob/init.cpp')
-rw-r--r-- | engines/gob/init.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/engines/gob/init.cpp b/engines/gob/init.cpp index 8f0311b1fc..299288878b 100644 --- a/engines/gob/init.cpp +++ b/engines/gob/init.cpp @@ -217,8 +217,15 @@ memBlocks = word ptr -2*/ delete[] _vm->_global->_inter_variables; delete[] _vm->_game->_totFileData; - delete[] _vm->_game->_totTextData; - delete[] _vm->_game->_totResourceTable; + if (_vm->_game->_totTextData) { + if (_vm->_game->_totTextData->items) + delete[] _vm->_game->_totTextData->items; + delete _vm->_game->_totTextData; + } + if (_vm->_game->_totResourceTable) { + delete[] _vm->_game->_totResourceTable->items; + delete _vm->_game->_totResourceTable; + } } for (i = 0; i < 4; i++) { |