mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 17:13:06 +08:00
Simplify disposing
This commit is contained in:
parent
3af1aaeabe
commit
d772bbaf8c
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user