Fixed the crash at the beginning of EcoQuest 1 CD

svn-id: r43875
This commit is contained in:
Filippos Karapetis
2009-09-01 06:45:30 +00:00
parent 814a37846e
commit 267bbb2bb4
+3 -1
View File
@@ -301,7 +301,9 @@ reg_t kDisposeScript(EngineState *s, int funct_nr, int argc, reg_t *argv) {
Script *scr = s->segmentManager->getScriptIfLoaded(id);
if (scr) {
if (s->_executionStack.back().addr.pc.segment != id)
scr->setLockers(1);
// Lockers must be > 1, otherwise it won't have any effect on script_uninstantiate() below,
// because it decreases the lockers by 1. This occurs for example at the beginning of EcoQuest CD
scr->setLockers(2);
}
script_uninstantiate(s->segmentManager, script);