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

Method Release

sdk/angelscript/source/as_scriptfunction.cpp:517–537  ·  view source on GitHub ↗

interface

Source from the content-addressed store, hash-verified

515
516// interface
517int asCScriptFunction::Release() const
518{
519 gcFlag = false;
520 int r = externalRefCount.atomicDec();
521 if( r == 0 &&
522 funcType != asFUNC_DUMMY ) // Dummy functions are allocated on the stack and cannot be deleted
523 {
524 // There are no more external references, if there are also no
525 // internal references then it is time to delete the function
526 if( internalRefCount.get() == 0 )
527 {
528 // If there are no internal references, then no module is owning the function
529 // For example if the function was dynamically compiled without adding it to the scope of the module
530 asASSERT( module == 0 );
531
532 asDELETE(const_cast<asCScriptFunction*>(this),asCScriptFunction);
533 }
534 }
535
536 return r;
537}
538
539// internal
540int asCScriptFunction::AddRefInternal()

Callers 2

ReleaseReferencesMethod · 0.45

Calls 2

atomicDecMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected