From 9d481854f30c7e5da7f865e7b970fd4538c26569 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Wed, 18 May 2022 14:13:31 +0200 Subject: [PATCH] Make currentSounds readonly --- OpenRA.Game/Sound/Sound.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Sound/Sound.cs b/OpenRA.Game/Sound/Sound.cs index 8eaf3772cd..cd047ab6c2 100644 --- a/OpenRA.Game/Sound/Sound.cs +++ b/OpenRA.Game/Sound/Sound.cs @@ -44,7 +44,7 @@ namespace OpenRA ISound music; ISound video; MusicInfo currentMusic; - Dictionary currentSounds = new Dictionary(); + readonly Dictionary currentSounds = new Dictionary(); readonly Dictionary currentNotifications = new Dictionary(); public bool DummyEngine { get; } @@ -96,7 +96,7 @@ namespace OpenRA Func loadIntoMemory = soundFormat => soundEngine.AddSoundSourceFromMemory( soundFormat.GetPCMInputStream().ReadAllBytes(), soundFormat.Channels, soundFormat.SampleBits, soundFormat.SampleRate); sounds = new Cache(filename => LoadSound(filename, loadIntoMemory)); - currentSounds = new Dictionary(); + currentSounds.Clear(); video = null; }