mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:52:57 +08:00
Simplify disposing
This commit is contained in:
parent
3af1aaeabe
commit
d772bbaf8c
@ -307,11 +307,10 @@ namespace osu.Game
|
||||
if (nextBeatmap?.Track != null)
|
||||
nextBeatmap.Track.Completed += currentTrackCompleted;
|
||||
|
||||
var oldBeatmap = beatmap.OldValue;
|
||||
if (oldBeatmap?.Track != null)
|
||||
oldBeatmap.Track.Completed -= currentTrackCompleted;
|
||||
using (var oldBeatmap = beatmap.OldValue)
|
||||
if (oldBeatmap?.Track != null)
|
||||
oldBeatmap.Track.Completed -= currentTrackCompleted;
|
||||
|
||||
oldBeatmap?.Dispose();
|
||||
nextBeatmap?.LoadBeatmapAsync();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user