MCPcopy Create free account
hub / github.com/anjo76/angelscript / ~asCScriptFunction

Method ~asCScriptFunction

sdk/angelscript/source/as_scriptfunction.cpp:413–433  ·  view source on GitHub ↗

internal

Source from the content-addressed store, hash-verified

411
412// internal
413asCScriptFunction::~asCScriptFunction()
414{
415 // Dummy functions that are allocated on the stack are not reference counted
416 asASSERT( funcType == asFUNC_DUMMY ||
417 (externalRefCount.get() == 0 && internalRefCount.get() == 0) );
418
419 // Remove the script function from the engine's scriptFunctions array here
420 // Don't remove it before, because there may still be functions referring to it
421 // by index until now. If it was removed in DestroyInternal, those would not
422 // be able to release the refcount, thus causing memory leak.
423 if( engine && id != 0 && funcType != asFUNC_DUMMY )
424 engine->RemoveScriptFunction(this);
425
426 // If the engine pointer is 0, then DestroyInternal has already been called and there is nothing more to do
427 if( engine == 0 ) return;
428
429 DestroyInternal();
430
431 // Finally set the engine pointer to 0 because it must not be accessed again
432 engine = 0;
433}
434
435// internal
436void asCScriptFunction::DestroyHalfCreated()

Callers

nothing calls this directly

Calls 2

RemoveScriptFunctionMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected