Dispose the intermediate Stream after copying it to pkgStream.

This commit is contained in:
Matthias Mailänder
2016-07-09 20:07:36 +02:00
parent 5c230803fe
commit 2ab82664e3

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);