Fixed IDisposable implementation and usage.

- Implement IDisposable interface correctly, with sealed classes where possible for simplicity.
- Add using statement around undisposed local variables.
This commit is contained in:
RoosterDragon
2014-05-21 06:19:26 +01:00
parent 334a210231
commit a598a01108
37 changed files with 248 additions and 260 deletions

View File

@@ -31,7 +31,8 @@ namespace OpenRA.GameRules
return;
Exists = true;
Length = (int)AudLoader.SoundLength(GlobalFileSystem.Open(Filename));
using (var s = GlobalFileSystem.Open(Filename))
Length = (int)AudLoader.SoundLength(s);
}
public void Reload()
@@ -40,7 +41,8 @@ namespace OpenRA.GameRules
return;
Exists = true;
Length = (int)AudLoader.SoundLength(GlobalFileSystem.Open(Filename));
using (var s = GlobalFileSystem.Open(Filename))
Length = (int)AudLoader.SoundLength(s);
}
}
}