diff options
author | frosch <frosch@openttd.org> | 2015-08-10 20:04:31 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2015-08-10 20:04:31 +0000 |
commit | e5d105900ddcb82bc2adf7accb4be010e3b20113 (patch) | |
tree | 2fbedf4eb33eb065b3fdc7b6f218a04b0c17dd67 /src/script/api/script_testmode.cpp | |
parent | d818e1779c9ef9770e93c502b90e16caff7254aa (diff) | |
download | openttd-e5d105900ddcb82bc2adf7accb4be010e3b20113.tar.xz |
(svn r27379) -Codechange: Do not throw in the destructors of ScriptTest/ExecMode.
Diffstat (limited to 'src/script/api/script_testmode.cpp')
-rw-r--r-- | src/script/api/script_testmode.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/script/api/script_testmode.cpp b/src/script/api/script_testmode.cpp index 37f296de0..ed643c2d9 100644 --- a/src/script/api/script_testmode.cpp +++ b/src/script/api/script_testmode.cpp @@ -30,7 +30,7 @@ ScriptTestMode::ScriptTestMode() this->SetDoCommandMode(&ScriptTestMode::ModeProc, this); } -ScriptTestMode::~ScriptTestMode() +void ScriptTestMode::FinalRelease() { if (this->GetDoCommandModeInstance() != this) { /* Ignore this error if the script already died. */ @@ -38,5 +38,9 @@ ScriptTestMode::~ScriptTestMode() throw Script_FatalError("Testmode object was removed while it was not the latest *Mode object created."); } } +} + +ScriptTestMode::~ScriptTestMode() +{ this->SetDoCommandMode(this->last_mode, this->last_instance); } |