Ensure previews stop playing when they are removed from the draw hierarchy

This commit is contained in:
Dean Herbert 2018-01-19 15:46:42 +09:00
parent 64c32f5715
commit 652f273961
2 changed files with 8 additions and 0 deletions

View File

@ -106,6 +106,8 @@ namespace osu.Game.Overlays.Direct
beatmaps.BeatmapDownloadBegan += attachDownload;
}
public override bool DisposeOnDeathRemoval => true;
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);

View File

@ -145,6 +145,12 @@ namespace osu.Game.Overlays.Direct
}
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
Playing.Value = false;
}
private TrackLoader trackLoader;
private AudioManager audio;