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

Method DestroyInternal

sdk/angelscript/source/as_scriptfunction.cpp:453–501  ·  view source on GitHub ↗

internal

Source from the content-addressed store, hash-verified

451
452// internal
453void asCScriptFunction::DestroyInternal()
454{
455 // Clean up user data
456 for( asUINT n = 0; n < userData.GetLength(); n += 2 )
457 {
458 if( userData[n+1] )
459 {
460 for( asUINT c = 0; c < engine->cleanFunctionFuncs.GetLength(); c++ )
461 if( engine->cleanFunctionFuncs[c].type == userData[n] )
462 engine->cleanFunctionFuncs[c].cleanFunc(this);
463 }
464 }
465 userData.SetLength(0);
466
467 // Release all references the function holds to other objects
468 ReleaseReferences();
469 parameterTypes.SetLength(0);
470 returnType = asCDataType::CreatePrimitive(ttVoid, false);
471
472 for( asUINT p = 0; p < defaultArgs.GetLength(); p++ )
473 if( defaultArgs[p] )
474 asDELETE(defaultArgs[p], asCString);
475 defaultArgs.SetLength(0);
476
477 if( sysFuncIntf )
478 asDELETE(sysFuncIntf,asSSystemFunctionInterface);
479 sysFuncIntf = 0;
480
481 if( objectType )
482 {
483 objectType->ReleaseInternal();
484 objectType = 0;
485 }
486
487 DeallocateScriptFunctionData();
488
489 // Deallocate list pattern data
490 while( listPattern )
491 {
492 asSListPatternNode *n = listPattern->next;
493 asDELETE(listPattern, asSListPatternNode);
494 listPattern = n;
495 }
496
497 // Release template sub types
498 for (asUINT n = 0; n < templateSubTypes.GetLength(); n++)
499 if(templateSubTypes[n].GetTypeInfo())
500 templateSubTypes[n].GetTypeInfo()->ReleaseInternal();
501}
502
503// interface
504int asCScriptFunction::GetId() const

Callers

nothing calls this directly

Calls 4

GetTypeInfoMethod · 0.80
GetLengthMethod · 0.45
SetLengthMethod · 0.45
ReleaseInternalMethod · 0.45

Tested by

no test coverage detected