mirror of
https://github.com/ppy/osu
synced 2025-01-26 15:53:12 +00:00
Unsubscribe from Completed event on old beatmap
This commit is contained in:
parent
3a2e0fbba5
commit
3af1aaeabe
@ -307,8 +307,11 @@ namespace osu.Game
|
|||||||
if (nextBeatmap?.Track != null)
|
if (nextBeatmap?.Track != null)
|
||||||
nextBeatmap.Track.Completed += currentTrackCompleted;
|
nextBeatmap.Track.Completed += currentTrackCompleted;
|
||||||
|
|
||||||
beatmap.OldValue?.Dispose();
|
var oldBeatmap = beatmap.OldValue;
|
||||||
|
if (oldBeatmap?.Track != null)
|
||||||
|
oldBeatmap.Track.Completed -= currentTrackCompleted;
|
||||||
|
|
||||||
|
oldBeatmap?.Dispose();
|
||||||
nextBeatmap?.LoadBeatmapAsync();
|
nextBeatmap?.LoadBeatmapAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user