aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Mettifogo2007-02-04 15:48:51 +0000
committerNicola Mettifogo2007-02-04 15:48:51 +0000
commit890ee9728524e30719297624261f749d8138b65d (patch)
tree9564794136c95d0ef26674a9809701b95f8de8e9
parentf54a97a02cfcf7abf8fd06cbed25aa7bba7d41ee (diff)
downloadscummvm-rg350-890ee9728524e30719297624261f749d8138b65d.tar.gz
scummvm-rg350-890ee9728524e30719297624261f749d8138b65d.tar.bz2
scummvm-rg350-890ee9728524e30719297624261f749d8138b65d.zip
applied 2nd workaround to avoid crashes caused by labels when switching location
svn-id: r25388
-rw-r--r--engines/parallaction/location.cpp14
-rw-r--r--engines/parallaction/parallaction.cpp4
2 files changed, 16 insertions, 2 deletions
diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp
index 522383de05..4e9bf11bf3 100644
--- a/engines/parallaction/location.cpp
+++ b/engines/parallaction/location.cpp
@@ -308,6 +308,9 @@ void switchBackground(char *name) {
}
extern Zone *_hoverZone;
+extern Job *_jDrawLabel;
+extern Job *_jEraseLabel;
+
void Parallaction::changeLocation(char *location) {
debugC(1, kDebugLocation, "changeLocation to '%s'", location);
@@ -350,6 +353,17 @@ void Parallaction::changeLocation(char *location) {
debugC(2, kDebugLocation, "changeLocation: music stopped");
}
+ // WORKAROUND: this if-statement has been added to avoid crashes caused by
+ // execution of label jobs after a location switch. The other workaround in
+ // Parallaction::runGame should have been rendered useless by this one.
+ if (_jDrawLabel != NULL) {
+ removeJob(_jDrawLabel);
+ removeJob(_jEraseLabel);
+ _jDrawLabel = NULL;
+ _jEraseLabel = NULL;
+ }
+
+
_hoverZone = NULL;
if (_engineFlags & kEngineMouse) {
changeCursor( kCursorArrow );
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 2613195134..0cbc459809 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -138,8 +138,8 @@ uint16 _introSarcData2 = 1;
static Job *_jDrawInventory = NULL;
-static Job *_jDrawLabel = NULL;
-static Job *_jEraseLabel = NULL;
+Job *_jDrawLabel = NULL;
+Job *_jEraseLabel = NULL;
Zone *_hoverZone = NULL;
static Job *_jRunScripts = NULL;