Skip to content

Commit

Permalink
Merge pull request ppy#30389 from bdach/fix-looping-samples-not-stopping
Browse files Browse the repository at this point in the history
Fix old looping samples not stopping when replacing a `SkinnableSound`'s `Samples`
  • Loading branch information
peppy authored Oct 23, 2024
2 parents b1b0aad + 1008d32 commit c1453cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions osu.Game/Skinning/SkinnableSound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ private void updateSamples()
{
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();
Expand Down

0 comments on commit c1453cf

Please sign in to comment.