Skip to content

Commit

Permalink
[wasm] GenerateWasmBootJson - close file handles (#85482)
Browse files Browse the repository at this point in the history
Close files opened with `File.OpenRead` by utilizing the `using`
pattern.

Co-authored-by: Ankit Jain <[email protected]>
  • Loading branch information
github-actions[bot] and radical authored Apr 28, 2023
1 parent 2783ef8 commit 37d789b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ public void WriteBootJson(Stream output, string entryAssemblyName)
foreach (var configExtension in Extensions)
{
var key = configExtension.GetMetadata("key");
var config = (Dictionary<string, object>)configSerializer.ReadObject(File.OpenRead(configExtension.ItemSpec));
using var fs = File.OpenRead(configExtension.ItemSpec);
var config = (Dictionary<string, object>)configSerializer.ReadObject(fs);
result.extensions[key] = config;
}
}
Expand Down

0 comments on commit 37d789b

Please sign in to comment.