Unsubscribe from Completed event on old beatmap

This commit is contained in:
iiSaLMaN 2019-07-31 15:19:02 +03:00
parent 3a2e0fbba5
commit 3af1aaeabe

View File

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