diff options
-rw-r--r-- | engines/mohawk/livingbooks.cpp | 14 | ||||
-rw-r--r-- | engines/mohawk/livingbooks.h | 3 |
2 files changed, 15 insertions, 2 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 8b01489497..dafd1b02d7 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -3671,7 +3671,10 @@ LBProxyItem::~LBProxyItem() { delete _page; } -void LBProxyItem::init() { +void LBProxyItem::load() { + if (_loaded) + return; + Common::String leftover; Common::String filename = _vm->getFileNameFromConfig("Proxies", _desc.c_str(), leftover); if (!leftover.empty()) @@ -3690,6 +3693,15 @@ void LBProxyItem::init() { error("failed to open archive '%s' (for proxy '%s')", filename.c_str(), _desc.c_str()); _page = new LBPage(_vm); _page->open(pageArchive, baseId); + + LBItem::load(); +} + +void LBProxyItem::unload() { + delete _page; + _page = NULL; + + LBItem::unload(); } } // End of namespace Mohawk diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h index c76c4349ca..bbd11bd9c9 100644 --- a/engines/mohawk/livingbooks.h +++ b/engines/mohawk/livingbooks.h @@ -597,7 +597,8 @@ public: LBProxyItem(MohawkEngine_LivingBooks *_vm, LBPage *page, Common::Rect rect); ~LBProxyItem(); - void init(); + void load(); + void unload(); protected: class LBPage *_page; |