Fix scripting AssemblyLoadContext not getting unloaded
# Conflicts: # Source/Engine/Engine/NativeInterop.Managed.cs
This commit is contained in:
@@ -320,16 +320,22 @@ void MCore::UnloadEngine()
|
||||
ShutdownHostfxr();
|
||||
}
|
||||
|
||||
void MCore::CreateScriptingAssemblyLoadContext()
|
||||
{
|
||||
static void* CreateScriptingAssemblyLoadContextPtr = GetStaticMethodPointer(TEXT("CreateScriptingAssemblyLoadContext"));
|
||||
CallStaticMethod<void>(CreateScriptingAssemblyLoadContextPtr);
|
||||
}
|
||||
|
||||
#if USE_EDITOR
|
||||
|
||||
void MCore::ReloadScriptingAssemblyLoadContext()
|
||||
void MCore::UnloadScriptingAssemblyLoadContext()
|
||||
{
|
||||
// Clear any cached class attributes (see https://github.com/FlaxEngine/FlaxEngine/issues/1108)
|
||||
for (auto e : CachedClassHandles)
|
||||
e.Value->_attributes.Clear();
|
||||
|
||||
static void* ReloadScriptingAssemblyLoadContextPtr = GetStaticMethodPointer(TEXT("ReloadScriptingAssemblyLoadContext"));
|
||||
CallStaticMethod<void>(ReloadScriptingAssemblyLoadContextPtr);
|
||||
static void* UnloadScriptingAssemblyLoadContextPtr = GetStaticMethodPointer(TEXT("UnloadScriptingAssemblyLoadContext"));
|
||||
CallStaticMethod<void>(UnloadScriptingAssemblyLoadContextPtr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user