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

Method UnloadDomain

Source/Engine/Scripting/Runtime/Mono.cpp:198–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void MCore::UnloadDomain(const StringAnsi& domainName)
199{
200 int32 i = 0;
201 for (; i < MDomains.Count(); i++)
202 {
203 if (MDomains[i]->GetName() == domainName)
204 break;
205 }
206 if (i == MDomains.Count())
207 return;
208
209 auto domain = MDomains[i];
210#if MONO_DEBUG_ENABLE
211 //mono_debug_domain_unload(domain->GetNative());
212#endif
213 //mono_domain_finalize(domain->GetNative(), 2000);
214 MObject* exception = nullptr;
215 mono_domain_try_unload(domain->GetNative(), &exception);
216 if (exception)
217 {
218 MException ex(exception);
219 ex.Log(LogType::Fatal, TEXT("Scripting::Release"));
220 }
221 Delete(domain);
222 MDomains.RemoveAtKeepOrder(i);
223}
224
225#if 0
226

Callers

nothing calls this directly

Calls 6

DeleteFunction · 0.85
GetNativeMethod · 0.80
RemoveAtKeepOrderMethod · 0.80
CountMethod · 0.45
GetNameMethod · 0.45
LogMethod · 0.45

Tested by

no test coverage detected