// internal void asCScriptFunction::DestroyInternal() { // Clean up user data if( userData && engine->cleanFunctionFunc ) engine->cleanFunctionFunc(this); userData = 0; // Release all references the function holds to other objects ReleaseReferences(); parameterTypes.SetLength(0); returnType = asCDataType::CreatePrimitive(ttVoid, false); byteCode.SetLength(0); for( asUINT n = 0; n < variables.GetLength(); n++ ) asDELETE(variables[n],asSScriptVariable); variables.SetLength(0); for( asUINT p = 0; p < defaultArgs.GetLength(); p++ ) if( defaultArgs[p] ) asDELETE(defaultArgs[p], asCString); defaultArgs.SetLength(0); if( sysFuncIntf ) asDELETE(sysFuncIntf,asSSystemFunctionInterface); sysFuncIntf = 0; }
// internal void asCScriptFunction::DestroyInternal() { // Clean up user data if( userData && engine->cleanFunctionFunc ) engine->cleanFunctionFunc(this); userData = 0; // Release all references the function holds to other objects ReleaseReferences(); parameterTypes.SetLength(0); returnType = asCDataType::CreatePrimitive(ttVoid, false); for( asUINT p = 0; p < defaultArgs.GetLength(); p++ ) if( defaultArgs[p] ) asDELETE(defaultArgs[p], asCString); defaultArgs.SetLength(0); if( sysFuncIntf ) asDELETE(sysFuncIntf,asSSystemFunctionInterface); sysFuncIntf = 0; DeallocateScriptFunctionData(); // Deallocate list pattern data while( listPattern ) { asSListPatternNode *n = listPattern->next; asDELETE(listPattern, asSListPatternNode); listPattern = n; } }
asCScriptFunction::~asCScriptFunction() { ReleaseReferences(); for( asUINT n = 0; n < variables.GetLength(); n++ ) { DELETE(variables[n],asSScriptVariable); } if( sysFuncIntf ) { DELETE(sysFuncIntf,asSSystemFunctionInterface); } }
// internal void asCScriptFunction::DestroyInternal() { // Clean up user data for( asUINT n = 0; n < userData.GetLength(); n += 2 ) { if( userData[n+1] ) { for( asUINT c = 0; c < engine->cleanFunctionFuncs.GetLength(); c++ ) if( engine->cleanFunctionFuncs[c].type == userData[n] ) engine->cleanFunctionFuncs[c].cleanFunc(this); } } userData.SetLength(0); // Release all references the function holds to other objects ReleaseReferences(); parameterTypes.SetLength(0); returnType = asCDataType::CreatePrimitive(ttVoid, false); for( asUINT p = 0; p < defaultArgs.GetLength(); p++ ) if( defaultArgs[p] ) asDELETE(defaultArgs[p], asCString); defaultArgs.SetLength(0); if( sysFuncIntf ) asDELETE(sysFuncIntf,asSSystemFunctionInterface); sysFuncIntf = 0; if( objectType ) { objectType->ReleaseInternal(); objectType = 0; } DeallocateScriptFunctionData(); // Deallocate list pattern data while( listPattern ) { asSListPatternNode *n = listPattern->next; asDELETE(listPattern, asSListPatternNode); listPattern = n; } }