mirror of
https://github.com/crskycode/GARbro.git
synced 2025-01-11 20:39:29 +08:00
(LzReader): implement IDisposable interface.
This commit is contained in:
parent
e2cb4424c7
commit
e80d8c3366
@ -67,8 +67,8 @@ namespace GameRes.Formats.Kaguya
|
||||
if (0 == packed_entry.UnpackedSize)
|
||||
packed_entry.UnpackedSize = arc.File.View.ReadUInt32 (entry.Offset-4);
|
||||
using (var input = arc.File.CreateStream (entry.Offset, entry.Size))
|
||||
using (var reader = new LzReader (input, entry.Size, packed_entry.UnpackedSize))
|
||||
{
|
||||
var reader = new LzReader (input, entry.Size, packed_entry.UnpackedSize);
|
||||
reader.Unpack();
|
||||
return new MemoryStream (reader.Data);
|
||||
}
|
||||
@ -184,7 +184,7 @@ namespace GameRes.Formats.Kaguya
|
||||
}
|
||||
}
|
||||
|
||||
internal class LzReader : IDataUnpacker
|
||||
internal sealed class LzReader : IDisposable, IDataUnpacker
|
||||
{
|
||||
MsbBitStream m_input;
|
||||
byte[] m_output;
|
||||
@ -233,5 +233,17 @@ namespace GameRes.Formats.Kaguya
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region IDisposable Members
|
||||
bool _disposed = false;
|
||||
public void Dispose ()
|
||||
{
|
||||
if (!_disposed)
|
||||
{
|
||||
m_input.Dispose();
|
||||
_disposed = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user