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

Method UnloadEngine

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

Source from the content-addressed store, hash-verified

675#endif
676
677void MCore::UnloadEngine()
678{
679 // Only root domain should be alive at this point
680 for (auto domain : MDomains)
681 {
682 if (domain != MRootDomain)
683 Delete(domain);
684 }
685 MDomains.Clear();
686
687 if (MRootDomain)
688 {
689#if PLATFORM_WINDOWS && USE_EDITOR
690 // TODO: reduce issues with hot-reloading C# DLLs because sometimes it crashes on exit
691 __try
692#endif
693 {
694 mono_jit_cleanup(MRootDomain->GetNative());
695 }
696#if PLATFORM_WINDOWS && USE_EDITOR
697 __except (MonoHackSehExceptionHandler(nullptr))
698 {
699 }
700#endif
701 Delete(MRootDomain);
702 MRootDomain = nullptr;
703 }
704
705#ifdef USE_MONO_AOT_MODULE
706 Platform::FreeLibrary(MonoAotModuleHandle);
707#endif
708
709#if PLATFORM_LINUX && !USE_MONO_DYNAMIC_LIB
710 if (ThisLibHandle)
711 {
712 dlclose(ThisLibHandle);
713 ThisLibHandle = nullptr;
714 }
715#endif
716}
717
718void MCore::CreateScriptingAssemblyLoadContext()
719{

Callers

nothing calls this directly

Calls 4

DeleteFunction · 0.85
dlcloseFunction · 0.85
GetNativeMethod · 0.80
ClearMethod · 0.45

Tested by

no test coverage detected