Clean up sound devices on game exit.

This commit is contained in:
Paul Chote
2015-09-20 14:36:45 +01:00
parent ef55d646f7
commit d112083c44
5 changed files with 27 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ using OpenRA.Traits;
namespace OpenRA
{
public class Sound
public sealed class Sound : IDisposable
{
readonly ISoundEngine soundEngine;
Cache<string, ISoundSource> sounds;
@@ -368,5 +368,10 @@ namespace OpenRA
return PlayPredefined(rules, player, null, type.ToLowerInvariant(), notification, variant, true, WPos.Zero, 1f, false);
}
public void Dispose()
{
soundEngine.Dispose();
}
}
}