mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 17:47:29 +08:00
No need to dispose/unbind the delegates
This commit is contained in:
parent
76edcb4a67
commit
950c55d6d0
@ -80,8 +80,8 @@ namespace osu.Game.Overlays.Music
|
||||
|
||||
list.BeatmapSets = BeatmapSets = beatmaps.GetAllWithChildren<BeatmapSetInfo>(b => !b.DeletePending).ToList();
|
||||
|
||||
beatmaps.BeatmapSetAdded += onBeatmapSetAdded;
|
||||
beatmaps.BeatmapSetRemoved += onBeatmapSetRemoved;
|
||||
beatmaps.BeatmapSetAdded += s => list.AddBeatmapSet(s);
|
||||
beatmaps.BeatmapSetRemoved += s => list.RemoveBeatmapSet(s);
|
||||
|
||||
beatmapBacking.BindTo(game.Beatmap);
|
||||
|
||||
@ -92,17 +92,6 @@ namespace osu.Game.Overlays.Music
|
||||
};
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
if (beatmaps != null)
|
||||
{
|
||||
beatmaps.BeatmapSetAdded -= onBeatmapSetAdded;
|
||||
beatmaps.BeatmapSetRemoved -= onBeatmapSetRemoved;
|
||||
}
|
||||
|
||||
base.Dispose(isDisposing);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
@ -138,10 +127,6 @@ namespace osu.Game.Overlays.Music
|
||||
playSpecified(set.Beatmaps[0]);
|
||||
}
|
||||
|
||||
private void onBeatmapSetAdded(BeatmapSetInfo s) => list.AddBeatmapSet(s);
|
||||
|
||||
private void onBeatmapSetRemoved(BeatmapSetInfo s) => list.RemoveBeatmapSet(s);
|
||||
|
||||
public void PlayPrevious()
|
||||
{
|
||||
var currentID = beatmapBacking.Value?.BeatmapSetInfo.ID ?? -1;
|
||||
|
Loading…
Reference in New Issue
Block a user