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

@@ -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()
{