| 27 | #include "../../safeguards.h" |
| 28 | |
| 29 | void SimpleCountedObject::Release() |
| 30 | { |
| 31 | int32_t res = --this->ref_count; |
| 32 | assert(res >= 0); |
| 33 | if (res == 0) { |
| 34 | try { |
| 35 | this->FinalRelease(); // may throw, for example ScriptTest/ExecMode |
| 36 | } catch (...) { |
| 37 | delete this; |
| 38 | throw; |
| 39 | } |
| 40 | delete this; |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Get the storage associated with the current ScriptInstance. |
no test coverage detected