aboutsummaryrefslogtreecommitdiff
path: root/engines/pink
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pink')
-rw-r--r--engines/pink/pda_mgr.cpp3
-rw-r--r--engines/pink/pda_mgr.h3
-rw-r--r--engines/pink/pink.cpp1
3 files changed, 6 insertions, 1 deletions
diff --git a/engines/pink/pda_mgr.cpp b/engines/pink/pda_mgr.cpp
index 29911e19f6..7a151c0ca7 100644
--- a/engines/pink/pda_mgr.cpp
+++ b/engines/pink/pda_mgr.cpp
@@ -172,6 +172,9 @@ void PDAMgr::onMouseMove(Common::Point point) {
}
void PDAMgr::close() {
+ if (!_globalPage)
+ return;
+
delete _globalPage;
delete _page;
_globalPage = nullptr;
diff --git a/engines/pink/pda_mgr.h b/engines/pink/pda_mgr.h
index afcae1ba53..dda4cf020f 100644
--- a/engines/pink/pda_mgr.h
+++ b/engines/pink/pda_mgr.h
@@ -50,6 +50,8 @@ public:
void update() { _cursorMgr.update(); }
+ void close();
+
void onLeftButtonClick(Common::Point point);
void onLeftButtonUp(Common::Point point);
void onMouseMove(Common::Point point);
@@ -60,7 +62,6 @@ public:
void setLead(LeadActor *lead) { _lead = lead; }
private:
- void close();
void loadGlobal();
void initPerilButtons();
diff --git a/engines/pink/pink.cpp b/engines/pink/pink.cpp
index 2f645c76d4..895300a565 100644
--- a/engines/pink/pink.cpp
+++ b/engines/pink/pink.cpp
@@ -214,6 +214,7 @@ void PinkEngine::addModule(const Common::String &moduleName) {
void PinkEngine::removeModule() {
for (uint i = 0; i < _modules.size(); ++i) {
if (_module == _modules[i]) {
+ _pdaMgr.close();
_modules[i] = new ModuleProxy(_module->getName());
delete _module;
_module = nullptr;