Merge pull request #11654 from Mailaender/dispose-installshieldcab

Fixed a resource leak on OpenRA.Utility.exe --list-installshield-cab
This commit is contained in:
abcdefg30
2016-07-15 15:28:59 +02:00
committed by GitHub

View File

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