aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/livingbooks.cpp
diff options
context:
space:
mode:
authorAlyssa Milburn2011-11-25 22:59:30 +0100
committerAlyssa Milburn2011-11-25 22:59:30 +0100
commit4d4c84fd824ac4a4bea355c2248e47655272ee8b (patch)
treeb82ff4a6dfc71b134609115bbcce2b8083605679 /engines/mohawk/livingbooks.cpp
parentd5c50fe0b3f59ba0f0a34e89502a2190cf339e0d (diff)
downloadscummvm-rg350-4d4c84fd824ac4a4bea355c2248e47655272ee8b.tar.gz
scummvm-rg350-4d4c84fd824ac4a4bea355c2248e47655272ee8b.tar.bz2
scummvm-rg350-4d4c84fd824ac4a4bea355c2248e47655272ee8b.zip
MOHAWK: Load/unload LB proxies properly.
Diffstat (limited to 'engines/mohawk/livingbooks.cpp')
-rw-r--r--engines/mohawk/livingbooks.cpp14
1 files changed, 13 insertions, 1 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