Merge branch 'unload_alc_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-unload_alc_fix

This commit is contained in:
Wojtek Figat
2025-03-18 14:20:20 +01:00
31 changed files with 539 additions and 140 deletions

View File

@@ -182,6 +182,8 @@ bool ScriptingService::Init()
return true;
}
MCore::CreateScriptingAssemblyLoadContext();
// Cache root domain
_rootDomain = MCore::GetRootDomain();
@@ -710,7 +712,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();