Fix old looping samples not stopping when replacing a `SkinnableSound`'s `Samples`

Closes https://github.com/ppy/osu/issues/30365.
This commit is contained in:
Bartłomiej Dach 2024-10-22 14:30:29 +02:00
parent 53a340938a
commit 1008d32ddb
No known key found for this signature in database
1 changed files with 3 additions and 0 deletions

View File

@ -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();