1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 17:13:06 +08:00

Simplify disposing

This commit is contained in:
iiSaLMaN 2019-08-01 10:04:04 +03:00
parent 3af1aaeabe
commit d772bbaf8c

View File

@ -307,11 +307,10 @@ namespace osu.Game
if (nextBeatmap?.Track != null) if (nextBeatmap?.Track != null)
nextBeatmap.Track.Completed += currentTrackCompleted; nextBeatmap.Track.Completed += currentTrackCompleted;
var oldBeatmap = beatmap.OldValue; using (var oldBeatmap = beatmap.OldValue)
if (oldBeatmap?.Track != null) if (oldBeatmap?.Track != null)
oldBeatmap.Track.Completed -= currentTrackCompleted; oldBeatmap.Track.Completed -= currentTrackCompleted;
oldBeatmap?.Dispose();
nextBeatmap?.LoadBeatmapAsync(); nextBeatmap?.LoadBeatmapAsync();
} }