diff --git a/OpenRA.Game/FileSystem/ZipFile.cs b/OpenRA.Game/FileSystem/ZipFile.cs index 63d35c2788..4d619dc538 100644 --- a/OpenRA.Game/FileSystem/ZipFile.cs +++ b/OpenRA.Game/FileSystem/ZipFile.cs @@ -137,6 +137,9 @@ namespace OpenRA.FileSystem { if (pkg != null) pkg.Close(); + + if (pkgStream != null) + pkgStream.Dispose(); } } diff --git a/OpenRA.Game/ModMetadata.cs b/OpenRA.Game/ModMetadata.cs index d74ec7abc0..788794dbb6 100644 --- a/OpenRA.Game/ModMetadata.cs +++ b/OpenRA.Game/ModMetadata.cs @@ -47,7 +47,8 @@ namespace OpenRA { try { - package = new ZipFile(File.OpenRead(pair.Second), pair.Second); + using (var fileStream = File.OpenRead(pair.Second)) + package = new ZipFile(fileStream, pair.Second); } catch {