/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { IAssemblyLoader al = AssemblyLoader; foreach (IMetadataModule module in al.Modules) { al.Unload(module); } _instance = null; }
/// <summary> /// Initializes a new instance of the <see cref="RuntimeBase"/> class. /// </summary> protected RuntimeBase() { _instance = this; }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { IAssemblyLoader al = AssemblyLoader; foreach (IMetadataModule module in al.Modules) al.Unload(module); _instance = null; }
private IMetadataModule LoadAssembly(RuntimeBase runtime, string assemblyFileName) { try { IMetadataModule assemblyModule = runtime.AssemblyLoader.Load(assemblyFileName); // Try to load debug information for the compilation this.LoadAssemblyDebugInfo(assemblyFileName); return assemblyModule; } catch (BadImageFormatException bife) { throw new CompilationException(String.Format("Couldn't load input file {0} (invalid format).", assemblyFileName), bife); } }