MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnUnloaded

Method OnUnloaded

Source/Engine/Scripting/BinaryModule.cpp:1163–1187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1161}
1162
1163void ManagedBinaryModule::OnUnloaded(MAssembly* assembly)
1164{
1165 PROFILE_CPU();
1166 PROFILE_MEM(ScriptingCSharp);
1167
1168 // Clear managed-only types
1169 Types.Resize(_firstManagedTypeIndex);
1170 for (int32 i = 0; i < _managedMemoryBlocks.Count(); i++)
1171 Allocator::Free(_managedMemoryBlocks[i]);
1172 _managedMemoryBlocks.Clear();
1173
1174 // Clear managed types information
1175 for (ScriptingType& type : Types)
1176 {
1177 type.ManagedClass = nullptr;
1178 if (type.Type == ScriptingTypes::Script && type.Script.ScriptVTable)
1179 {
1180 Platform::Free(type.Script.ScriptVTable);
1181 type.Script.ScriptVTable = nullptr;
1182 }
1183 }
1184#if !COMPILE_WITHOUT_CSHARP
1185 ClassToTypeIndex.Clear();
1186#endif
1187}
1188
1189const StringAnsi& ManagedBinaryModule::GetName() const
1190{

Callers

nothing calls this directly

Calls 4

FreeFunction · 0.50
ResizeMethod · 0.45
CountMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected