aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2016-08-13 09:02:28 +0200
committerEugene Sandulenko2017-07-03 08:50:10 +0200
commitc623a767676f8422186933c87b569d39185b5496 (patch)
treebc23dde92851c8278c41a0002c2a8798144c604b /engines/mohawk/riven.cpp
parent9ab0d53cd3d8008b55d64cea832191f5ef2155ce (diff)
downloadscummvm-rg350-c623a767676f8422186933c87b569d39185b5496.tar.gz
scummvm-rg350-c623a767676f8422186933c87b569d39185b5496.tar.bz2
scummvm-rg350-c623a767676f8422186933c87b569d39185b5496.zip
MOHAWK: Ensure constructing and deleting cards does not have side effects
Diffstat (limited to 'engines/mohawk/riven.cpp')
-rw-r--r--engines/mohawk/riven.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 8b7ee885ae..e6d8a16811 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -384,7 +384,10 @@ void MohawkEngine_Riven::changeToCard(uint16 dest) {
}
}
- delete _card;
+ if (_card) {
+ _card->leave();
+ delete _card;
+ }
_card = new RivenCard(this, dest);
refreshCard(); // Handles hotspots and scripts
@@ -394,7 +397,7 @@ void MohawkEngine_Riven::refreshCard() {
// Clear any timer still floating around
removeTimer();
- _card->open();
+ _card->enter();
if (_showHotspots)
_card->drawHotspotRects();