Merge pull request #11622 from Mailaender/dispose-p

Fixed parent package from ZipFile not getting disposed.
This commit is contained in:
Matthias Mailänder
2016-07-27 14:41:17 +02:00
committed by GitHub

View File

@@ -57,7 +57,8 @@ namespace OpenRA.FileSystem
// SharpZipLib breaks when asked to update archives loaded from outside streams or files
// We can work around this by creating a clean in-memory-only file, cutting all outside references
pkgStream = new MemoryStream();
p.GetStream(name).CopyTo(pkgStream);
using (var sourceStream = p.GetStream(name))
sourceStream.CopyTo(pkgStream);
pkgStream.Position = 0;
pkg = new SZipFile(pkgStream);