Revert "Initialize ScriptingService earlier"
This reverts commit 0566e17b23273feffed0c41ed61f7e56d6e8f1a8.
This commit is contained in:
@@ -1248,7 +1248,7 @@ namespace FlaxEngine.Interop
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly]
|
||||
internal static void LoadScriptingAssemblyLoadContext()
|
||||
internal static void ReloadScriptingAssemblyLoadContext()
|
||||
{
|
||||
#if FLAX_EDITOR
|
||||
// Clear all caches which might hold references to assemblies in collectible ALC
|
||||
@@ -1272,18 +1272,16 @@ namespace FlaxEngine.Interop
|
||||
FlaxEngine.Json.JsonSerializer.ResetCache();
|
||||
|
||||
// Unload the ALC
|
||||
if (scriptingAssemblyLoadContext != null)
|
||||
{
|
||||
bool unloading = true;
|
||||
scriptingAssemblyLoadContext.Unloading += (alc) => { unloading = false; };
|
||||
scriptingAssemblyLoadContext.Unload();
|
||||
bool unloading = true;
|
||||
scriptingAssemblyLoadContext.Unloading += (alc) => { unloading = false; };
|
||||
scriptingAssemblyLoadContext.Unload();
|
||||
|
||||
while (unloading)
|
||||
System.Threading.Thread.Sleep(1);
|
||||
|
||||
while (unloading)
|
||||
System.Threading.Thread.Sleep(1);
|
||||
}
|
||||
#endif
|
||||
InitScriptingAssemblyLoadContext();
|
||||
DelegateHelpers.InitMethods();
|
||||
#endif
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly]
|
||||
|
||||
@@ -92,6 +92,8 @@ namespace FlaxEngine.Interop
|
||||
System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
|
||||
System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
|
||||
|
||||
InitScriptingAssemblyLoadContext();
|
||||
DelegateHelpers.InitMethods();
|
||||
}
|
||||
|
||||
#if FLAX_EDITOR
|
||||
|
||||
Reference in New Issue
Block a user