internal
| 6529 | |
| 6530 | // internal |
| 6531 | int asCScriptEngine::GetScriptSectionNameIndex(const char *name) |
| 6532 | { |
| 6533 | ACQUIREEXCLUSIVE(engineRWLock); |
| 6534 | |
| 6535 | // TODO: These names are only released when the engine is freed. The assumption is that |
| 6536 | // the same script section names will be reused instead of there always being new |
| 6537 | // names. Is this assumption valid? Do we need to add reference counting? |
| 6538 | |
| 6539 | // Store the script section names for future reference |
| 6540 | for( asUINT n = 0; n < scriptSectionNames.GetLength(); n++ ) |
| 6541 | { |
| 6542 | if( scriptSectionNames[n]->Compare(name) == 0 ) |
| 6543 | { |
| 6544 | RELEASEEXCLUSIVE(engineRWLock); |
| 6545 | return n; |
| 6546 | } |
| 6547 | } |
| 6548 | |
| 6549 | asCString *str = asNEW(asCString)(name); |
| 6550 | if( str ) |
| 6551 | scriptSectionNames.PushLast(str); |
| 6552 | int r = int(scriptSectionNames.GetLength()-1); |
| 6553 | |
| 6554 | RELEASEEXCLUSIVE(engineRWLock); |
| 6555 | |
| 6556 | return r; |
| 6557 | } |
| 6558 | |
| 6559 | // interface |
| 6560 | void asCScriptEngine::SetEngineUserDataCleanupCallback(asCLEANENGINEFUNC_t callback, asPWORD type) |
no test coverage detected