From fabc3e98b297a5ded1491e2c4e7cf5aa6a258667 Mon Sep 17 00:00:00 2001 From: Ray Koopa Date: Sat, 27 Jun 2020 16:57:39 +0200 Subject: [PATCH] Properly leave open streams when saving to them for GeneratedMap and LandData instances. --- src/library/Syroot.Worms.Armageddon/GeneratedMap.cs | 2 +- src/library/Syroot.Worms.Armageddon/LandData.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/library/Syroot.Worms.Armageddon/GeneratedMap.cs b/src/library/Syroot.Worms.Armageddon/GeneratedMap.cs index 687f29b..6656497 100644 --- a/src/library/Syroot.Worms.Armageddon/GeneratedMap.cs +++ b/src/library/Syroot.Worms.Armageddon/GeneratedMap.cs @@ -57,7 +57,7 @@ namespace Syroot.Worms.Armageddon /// public void Save(Stream stream) { - using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII); + using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); writer.WriteStruct(Settings); } diff --git a/src/library/Syroot.Worms.Armageddon/LandData.cs b/src/library/Syroot.Worms.Armageddon/LandData.cs index 09dc380..d2a9364 100644 --- a/src/library/Syroot.Worms.Armageddon/LandData.cs +++ b/src/library/Syroot.Worms.Armageddon/LandData.cs @@ -129,7 +129,7 @@ namespace Syroot.Worms.Armageddon /// public void Save(Stream stream) { - using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII); + using BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true); // Write the header. writer.Write(_signature);