internal
| 411 | |
| 412 | // internal |
| 413 | asCScriptFunction::~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 |
| 436 | void asCScriptFunction::DestroyHalfCreated() |
nothing calls this directly
no test coverage detected