mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-16 21:07:45 +01:00
20 lines
472 B
C#
20 lines
472 B
C#
using Penumbra.Util;
|
|
|
|
namespace Penumbra.Import.Structs;
|
|
|
|
// Create an automatically disposing SqPack stream.
|
|
public class StreamDisposer : PenumbraSqPackStream
|
|
{
|
|
private readonly FileStream _fileStream;
|
|
|
|
public StreamDisposer(FileStream stream)
|
|
: base(stream)
|
|
=> _fileStream = stream;
|
|
|
|
protected override void Dispose(bool _)
|
|
{
|
|
var filePath = _fileStream.Name;
|
|
_fileStream.Dispose();
|
|
File.Delete(filePath);
|
|
}
|
|
}
|