aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-06-15 20:07:56 +0000
committerTorbjörn Andersson2005-06-15 20:07:56 +0000
commitb5b4d3d99764724dce7f0ad7061c05e5ccbfcf76 (patch)
treedcd53748a4c4296a0117a683f558eb3ce8ad5c22 /saga
parent1e2131d0eec4a4cc828cb21c329912d427823053 (diff)
downloadscummvm-rg350-b5b4d3d99764724dce7f0ad7061c05e5ccbfcf76.tar.gz
scummvm-rg350-b5b4d3d99764724dce7f0ad7061c05e5ccbfcf76.tar.bz2
scummvm-rg350-b5b4d3d99764724dce7f0ad7061c05e5ccbfcf76.zip
Don't access the thread after sfScriptGotoScene. As the comment points out,
the thread has been destroyed. This fixes a crash when leaving the ferret guild lodge, and probably other places as well. svn-id: r18399
Diffstat (limited to 'saga')
-rw-r--r--saga/sthread.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/saga/sthread.cpp b/saga/sthread.cpp
index 19cbbdb91f..24815040d5 100644
--- a/saga/sthread.cpp
+++ b/saga/sthread.cpp
@@ -347,12 +347,12 @@ bool Script::runThread(ScriptThread *thread, uint instructionLimit) {
(this->*scriptFunction)(thread, argumentsCount);
- thread->_stackTopIndex = checkStackTopIndex;
-
if (scriptFunction == &Saga::Script::sfScriptGotoScene) {
return true; // cause abortAllThreads called and _this_ thread destroyed
}
+ thread->_stackTopIndex = checkStackTopIndex;
+
if (operandChar == opCcall) {// CALL function
thread->push(thread->_returnValue);
}