interface
| 515 | |
| 516 | // interface |
| 517 | int 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 |
| 540 | int asCScriptFunction::AddRefInternal() |
no test coverage detected