From 0c3aef8645f234acdc8a4ceb4646af176ea8963b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 12 Feb 2021 17:42:02 +0900 Subject: [PATCH] Fix potential race in looping sample As mentioned via GitHub comments. Very unlikely for this to happen unless: the sample takes a short amount of time to load, is very short itself, and the update thread stalls until the sample fully completes. --- osu.Game/Skinning/PoolableSkinnableSample.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Skinning/PoolableSkinnableSample.cs b/osu.Game/Skinning/PoolableSkinnableSample.cs index cff793e8d4..45880a8e1e 100644 --- a/osu.Game/Skinning/PoolableSkinnableSample.cs +++ b/osu.Game/Skinning/PoolableSkinnableSample.cs @@ -115,8 +115,7 @@ namespace osu.Game.Skinning if (Sample == null) return; - activeChannel = Sample.Play(); - activeChannel.Looping = Looping; + activeChannel = Sample.Play(Looping); Played = true; }