Merge pull request #11654 from Mailaender/dispose-installshieldcab
Fixed a resource leak on OpenRA.Utility.exe --list-installshield-cab
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user