mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
25 lines
No EOL
525 B
C#
25 lines
No EOL
525 B
C#
using Penumbra.Util;
|
|
using System;
|
|
using System.IO;
|
|
|
|
namespace Penumbra.Import;
|
|
|
|
// Create an automatically disposing SqPack stream.
|
|
public class StreamDisposer : PenumbraSqPackStream, IDisposable
|
|
{
|
|
private readonly FileStream _fileStream;
|
|
|
|
public StreamDisposer( FileStream stream )
|
|
: base( stream )
|
|
=> _fileStream = stream;
|
|
|
|
public new void Dispose()
|
|
{
|
|
var filePath = _fileStream.Name;
|
|
|
|
base.Dispose();
|
|
_fileStream.Dispose();
|
|
|
|
File.Delete( filePath );
|
|
}
|
|
} |