1
0
mirror of synced 2025-02-26 14:51:47 +01:00

Try to fix the file loader disposing streams

This commit is contained in:
KillzXGaming 2019-07-25 14:31:33 -04:00
parent d5b084e4e4
commit 40c0fcae11

View File

@ -178,7 +178,7 @@ namespace Toolbox.Library.IO
{ {
if (compressionFormat.Identify(stream)) if (compressionFormat.Identify(stream))
{ {
compressionFormat.Decompress(stream); stream = compressionFormat.Decompress(stream);
} }
} }
@ -349,10 +349,7 @@ namespace Toolbox.Library.IO
if (Compressed) if (Compressed)
fileFormat.IFileInfo.CompressionType = CompType; fileFormat.IFileInfo.CompressionType = CompType;
fileFormat.Load(stream); fileFormat.Load(stream);
if (fileFormat is TreeNode) if (fileFormat is TreeNode)
{ {
if (archiveNode != null) if (archiveNode != null)
@ -366,8 +363,8 @@ namespace Toolbox.Library.IO
if (!LeaveStreamOpen) if (!LeaveStreamOpen)
{ {
stream.Close();
stream.Dispose(); stream.Dispose();
GC.SuppressFinalize(stream);
} }
return fileFormat; return fileFormat;