| 14 | } |
| 15 | |
| 16 | static void ScriptWeakRefConstruct2(asITypeInfo *type, void *ref, void *mem) |
| 17 | { |
| 18 | new(mem) CScriptWeakRef(ref, type); |
| 19 | |
| 20 | // It's possible the constructor raised a script exception, in which case we |
| 21 | // need to call the destructor in order to cleanup the memory before returning |
| 22 | asIScriptContext *ctx = asGetActiveContext(); |
| 23 | if( ctx && ctx->GetState() == asEXECUTION_EXCEPTION ) |
| 24 | reinterpret_cast<CScriptWeakRef*>(mem)->~CScriptWeakRef(); |
| 25 | } |
| 26 | |
| 27 | static void ScriptWeakRefDestruct(CScriptWeakRef *obj) |
| 28 | { |
no test coverage detected