Dispose DependencyContextJsonReader after using
This commit is contained in:
committed by
Gustas
parent
bd882c98c7
commit
4517734fbe
@@ -265,12 +265,14 @@ namespace OpenRA.Support
|
|||||||
|
|
||||||
public static AssemblyLoadContextBuilder AddDependencyContext(this AssemblyLoadContextBuilder builder, string depsFilePath)
|
public static AssemblyLoadContextBuilder AddDependencyContext(this AssemblyLoadContextBuilder builder, string depsFilePath)
|
||||||
{
|
{
|
||||||
var reader = new DependencyContextJsonReader();
|
using (var reader = new DependencyContextJsonReader())
|
||||||
using (var file = File.OpenRead(depsFilePath))
|
|
||||||
{
|
{
|
||||||
var deps = reader.Read(file);
|
using (var file = File.OpenRead(depsFilePath))
|
||||||
builder.SetBaseDirectory(Path.GetDirectoryName(depsFilePath));
|
{
|
||||||
builder.AddDependencyContext(deps);
|
var deps = reader.Read(file);
|
||||||
|
builder.SetBaseDirectory(Path.GetDirectoryName(depsFilePath));
|
||||||
|
builder.AddDependencyContext(deps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
|
|||||||
Reference in New Issue
Block a user