Scriptloading overhaul (#163)
* - Added option to RunConfig.cs for mods to compile with non-publicized assemblies. - Added default values attrib to RunConfig.cs - Added thread sleeping to CsPackageManager.Dispose() to give time before generating a strong-ref to check acl unload status. * - Added PrintWarning to ModUtils.cs - Made previously unloaded ACLs warning only. - Made plugins unload after lua script disposal. - Small code cleanups. - Cleared acl record references on unloading. - Made ACL unload run via event hook. * Made non-pub asm compilation name the same long-a** name in XML, as per Evil's request.
This commit is contained in:
+4
-2
@@ -34,6 +34,7 @@ public class MemoryFileAssemblyContextLoader : AssemblyLoadContext
|
||||
public MemoryFileAssemblyContextLoader(AssemblyManager assemblyManager) : base(isCollectible: true)
|
||||
{
|
||||
this._assemblyManager = assemblyManager;
|
||||
base.Unloading += OnUnload;
|
||||
}
|
||||
|
||||
|
||||
@@ -278,10 +279,11 @@ public class MemoryFileAssemblyContextLoader : AssemblyLoadContext
|
||||
}
|
||||
|
||||
|
||||
public new void Unload()
|
||||
private void OnUnload(AssemblyLoadContext alc)
|
||||
{
|
||||
CompiledAssembly = null;
|
||||
CompiledAssemblyImage = null;
|
||||
base.Unload();
|
||||
_dependencyResolvers.Clear();
|
||||
base.Unloading -= OnUnload;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user