Dispose the file open read stream.

This commit is contained in:
Matthias Mailänder
2016-07-15 07:37:28 +02:00
parent d54de291b7
commit eb586fb37c

View File

@@ -29,12 +29,15 @@ namespace OpenRA.Mods.Common.UtilityCommands
[Desc("DATA.HDR", "Lists the filenames contained within an Installshield CAB volume set")] [Desc("DATA.HDR", "Lists the filenames contained within an Installshield CAB volume set")]
public void Run(ModData modData, string[] args) public void Run(ModData modData, string[] args)
{ {
var package = new InstallShieldCABCompression(File.OpenRead(args[1]), null); using (var file = File.OpenRead(args[1]))
foreach (var volume in package.Contents.OrderBy(kv => kv.Key))
{ {
Console.WriteLine("Volume: {0}", volume.Key); var package = new InstallShieldCABCompression(file, null);
foreach (var filename in volume.Value) foreach (var volume in package.Contents.OrderBy(kv => kv.Key))
Console.WriteLine("\t{0}", filename); {
Console.WriteLine("Volume: {0}", volume.Key);
foreach (var filename in volume.Value)
Console.WriteLine("\t{0}", filename);
}
} }
} }
} }