summaryrefslogtreecommitdiff
path: root/src/script/api/script_execmode.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-08-10 20:04:31 +0000
committerfrosch <frosch@openttd.org>2015-08-10 20:04:31 +0000
commite5d105900ddcb82bc2adf7accb4be010e3b20113 (patch)
tree2fbedf4eb33eb065b3fdc7b6f218a04b0c17dd67 /src/script/api/script_execmode.cpp
parentd818e1779c9ef9770e93c502b90e16caff7254aa (diff)
downloadopenttd-e5d105900ddcb82bc2adf7accb4be010e3b20113.tar.xz
(svn r27379) -Codechange: Do not throw in the destructors of ScriptTest/ExecMode.
Diffstat (limited to 'src/script/api/script_execmode.cpp')
-rw-r--r--src/script/api/script_execmode.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/script/api/script_execmode.cpp b/src/script/api/script_execmode.cpp
index 4fb0cc7e2..1bbce807a 100644
--- a/src/script/api/script_execmode.cpp
+++ b/src/script/api/script_execmode.cpp
@@ -30,7 +30,7 @@ ScriptExecMode::ScriptExecMode()
this->SetDoCommandMode(&ScriptExecMode::ModeProc, this);
}
-ScriptExecMode::~ScriptExecMode()
+void ScriptExecMode::FinalRelease()
{
if (this->GetDoCommandModeInstance() != this) {
/* Ignore this error if the script already died. */
@@ -38,5 +38,9 @@ ScriptExecMode::~ScriptExecMode()
throw Script_FatalError("ScriptExecMode object was removed while it was not the latest *Mode object created.");
}
}
+}
+
+ScriptExecMode::~ScriptExecMode()
+{
this->SetDoCommandMode(this->last_mode, this->last_instance);
}