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/misc | |
parent | d818e1779c9ef9770e93c502b90e16caff7254aa (diff) | |
download | openttd-e5d105900ddcb82bc2adf7accb4be010e3b20113.tar.xz |
(svn r27379) -Codechange: Do not throw in the destructors of ScriptTest/ExecMode.
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/countedobj.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/misc/countedobj.cpp b/src/misc/countedobj.cpp index 28f614afa..837d1c177 100644 --- a/src/misc/countedobj.cpp +++ b/src/misc/countedobj.cpp @@ -25,7 +25,12 @@ int32 SimpleCountedObject::Release() int32 res = --m_ref_cnt; assert(res >= 0); if (res == 0) { - FinalRelease(); + try { + FinalRelease(); // may throw, for example ScriptTest/ExecMode + } catch (...) { + delete this; + throw; + } delete this; } return res; |