Clean up sound devices on game exit.
This commit is contained in:
@@ -672,6 +672,7 @@ namespace OpenRA
|
||||
worldRenderer.Dispose();
|
||||
ModData.Dispose();
|
||||
ChromeProvider.Deinitialize();
|
||||
Sound.Dispose();
|
||||
Renderer.Dispose();
|
||||
|
||||
OnQuit();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ using System;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
public interface ISoundEngine
|
||||
public interface ISoundEngine : IDisposable
|
||||
{
|
||||
SoundDevice[] AvailableDevices();
|
||||
ISoundSource AddSoundSourceFromMemory(byte[] data, int channels, int sampleBits, int sampleRate);
|
||||
|
||||
Reference in New Issue
Block a user