From 40fca105f8f937010a48f0587606f28c6ea89d44 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Wed, 2 Sep 2020 18:50:48 -0400 Subject: [PATCH] Force streams to close when swithced to a decompressed stream. --- Switch_Toolbox_Library/IO/STFileLoader.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Switch_Toolbox_Library/IO/STFileLoader.cs b/Switch_Toolbox_Library/IO/STFileLoader.cs index f1cc277a..cacf5567 100644 --- a/Switch_Toolbox_Library/IO/STFileLoader.cs +++ b/Switch_Toolbox_Library/IO/STFileLoader.cs @@ -198,10 +198,12 @@ namespace Toolbox.Library.IO { stream.Position = streamStartPos; - stream = compressionFormat.Decompress(stream); - CompressedSize = stream.Length; + Stream decompStream = compressionFormat.Decompress(stream); + stream.Close(); - return OpenFileFormat(stream, FileName, LeaveStreamOpen, InArchive, + CompressedSize = decompStream.Length; + + return OpenFileFormat(decompStream, FileName, LeaveStreamOpen, InArchive, true, compressionFormat, DecompressedSize, CompressedSize); } }