Fix scripting AssemblyLoadContext not getting unloaded
# Conflicts: # Source/Engine/Engine/NativeInterop.Managed.cs
This commit is contained in:
@@ -175,6 +175,8 @@ bool ScriptingService::Init()
|
||||
return true;
|
||||
}
|
||||
|
||||
MCore::CreateScriptingAssemblyLoadContext();
|
||||
|
||||
// Cache root domain
|
||||
_rootDomain = MCore::GetRootDomain();
|
||||
|
||||
@@ -703,7 +705,8 @@ void Scripting::Reload(bool canTriggerSceneReload)
|
||||
_hasGameModulesLoaded = false;
|
||||
|
||||
// Release and create a new assembly load context for user assemblies
|
||||
MCore::ReloadScriptingAssemblyLoadContext();
|
||||
MCore::UnloadScriptingAssemblyLoadContext();
|
||||
MCore::CreateScriptingAssemblyLoadContext();
|
||||
|
||||
// Give GC a try to cleanup old user objects and the other mess
|
||||
MCore::GC::Collect();
|
||||
|
||||
Reference in New Issue
Block a user