diff --git a/osu.Framework/Audio/Sample/Sample.cs b/osu.Framework/Audio/Sample/Sample.cs index 54bd3f1174..1f536aa436 100644 --- a/osu.Framework/Audio/Sample/Sample.cs +++ b/osu.Framework/Audio/Sample/Sample.cs @@ -53,5 +53,18 @@ private void onPlay(SampleChannel channel) /// /// The for the playback. protected abstract SampleChannel CreateChannel(); + + // SampleChannel IsAlive can be false if Playing is not true, even if it is not disposed yet. + // Mixer removes the channel from itself after playing to the end, so if we don't dispose this item here, it's forever lost. + protected override void ItemRemoved(SampleChannel item) + { + base.ItemRemoved(item); + + if (!item.IsDisposed) + { + item.Dispose(); + item.Update(); + } + } } }