MCPcopy Create free account
hub / github.com/anjo76/angelscript / ScriptWeakRefConstruct2

Function ScriptWeakRefConstruct2

sdk/add_on/weakref/weakref.cpp:16–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16static 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
27static void ScriptWeakRefDestruct(CScriptWeakRef *obj)
28{

Callers 1

Calls 2

GetStateMethod · 0.80
~CScriptWeakRefMethod · 0.80

Tested by

no test coverage detected