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:
RoosterDragon
2015-07-17 22:27:24 +01:00
parent 1e7da8514a
commit ce73bb909e
9 changed files with 186 additions and 118 deletions

View File

@@ -13,7 +13,7 @@ using System.IO;
namespace OpenRA.FileSystem
{
public class Folder : IFolder
public sealed class Folder : IFolder
{
readonly string path;
readonly int priority;
@@ -78,5 +78,7 @@ namespace OpenRA.FileSystem
using (var writer = new BinaryWriter(dataStream))
writer.Write(file.Value);
}
public void Dispose() { }
}
}