Make IFolder interface inherently IDisposable.
Fix up implementations to ensure they dispose any stream they acquire, and ensure the constructor will not leave a stream open if it fails. Dispose folders when unmounting them in GlobalFileSystem.
This commit is contained in:
@@ -17,11 +17,11 @@ using SZipFile = ICSharpCode.SharpZipLib.Zip.ZipFile;
|
||||
|
||||
namespace OpenRA.FileSystem
|
||||
{
|
||||
public sealed class ZipFile : IFolder, IDisposable
|
||||
public sealed class ZipFile : IFolder
|
||||
{
|
||||
string filename;
|
||||
readonly string filename;
|
||||
readonly int priority;
|
||||
SZipFile pkg;
|
||||
int priority;
|
||||
|
||||
static ZipFile()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user