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:
@@ -39,9 +39,11 @@ namespace OpenRA
|
||||
}
|
||||
|
||||
if (filename.ToLowerInvariant().EndsWith("wav"))
|
||||
return LoadWave(new WavLoader(GlobalFileSystem.Open(filename)));
|
||||
using (var s = GlobalFileSystem.Open(filename))
|
||||
return LoadWave(new WavLoader(s));
|
||||
|
||||
return LoadSoundRaw(AudLoader.LoadSound(GlobalFileSystem.Open(filename)));
|
||||
using (var s = GlobalFileSystem.Open(filename))
|
||||
return LoadSoundRaw(AudLoader.LoadSound(s));
|
||||
}
|
||||
|
||||
static ISoundSource LoadWave(WavLoader wave)
|
||||
|
||||
Reference in New Issue
Block a user