Merge pull request #30389 from bdach/fix-looping-samples-not-stopping

Fix old looping samples not stopping when replacing a `SkinnableSound`'s `Samples`
This commit is contained in:
Dean Herbert 2024-10-23 18:39:55 +09:00 committed by GitHub
commit c1453cfd0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -154,6 +154,9 @@ namespace osu.Game.Skinning
{
bool wasPlaying = IsPlaying;
if (wasPlaying && Looping)
Stop();
// Remove all pooled samples (return them to the pool), and dispose the rest.
samplesContainer.RemoveAll(s => s.IsInPool, false);
samplesContainer.Clear();