From 0781a992733f730a5c02a0c2a50c3400d4d552ab Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Mon, 6 Mar 2023 11:13:13 -0800 Subject: [PATCH] fix thread contention for audio tweens --- src/Audio/AudioDevice.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Audio/AudioDevice.cs b/src/Audio/AudioDevice.cs index 84a2c99..8892582 100644 --- a/src/Audio/AudioDevice.cs +++ b/src/Audio/AudioDevice.cs @@ -194,17 +194,17 @@ namespace MoonWorks.Audio float end, float duration ) { - var tween = AudioTweenPool.Obtain(); - tween.SoundInstanceReference = new WeakReference(soundInstance); - tween.Property = property; - tween.EasingFunction = easingFunction; - tween.Start = start; - tween.End = end; - tween.Duration = duration; - tween.Time = 0; - lock (StateLock) { + var tween = AudioTweenPool.Obtain(); + tween.SoundInstanceReference = new WeakReference(soundInstance); + tween.Property = property; + tween.EasingFunction = easingFunction; + tween.Start = start; + tween.End = end; + tween.Duration = duration; + tween.Time = 0; + AudioTweens.Add(tween); } }