mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
(ArcFile.OpenView): dispose of the intermediate stream.
This commit is contained in:
parent
6f8b57cc03
commit
f47432fc09
@ -153,9 +153,17 @@ namespace GameRes
|
||||
/// </summary>
|
||||
public ArcView OpenView (Entry entry)
|
||||
{
|
||||
var stream = OpenEntry (entry);
|
||||
uint size = stream.CanSeek ? (uint)stream.Length : entry.Size;
|
||||
return new ArcView (stream, entry.Name, size);
|
||||
using (var stream = OpenEntry (entry))
|
||||
{
|
||||
uint size;
|
||||
if (stream.CanSeek)
|
||||
size = (uint)stream.Length;
|
||||
else if (entry is PackedEntry)
|
||||
size = (entry as PackedEntry).UnpackedSize;
|
||||
else
|
||||
size = entry.Size;
|
||||
return new ArcView (stream, entry.Name, size);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user