diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 9dd5c9c0326..bd2891ef7a5 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -2909,6 +2909,16 @@ void LBGroupItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStre } } +void LBGroupItem::destroySelf() { + LBItem::destroySelf(); + + for (uint i = 0; i < _groupEntries.size(); i++) { + LBItem *item = _vm->getItemById(_groupEntries[i].entryId); + if (item) + item->destroySelf(); + } +} + void LBGroupItem::setEnabled(bool enabled) { if (_starting) { _starting = false; diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index 6c22187cf35..3cd9142793f 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -424,6 +424,7 @@ public: void readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEndian *stream); + void destroySelf(); void setEnabled(bool enabled); void setGlobalEnabled(bool enabled); bool contains(Common::Point point);