Merge pull request #7784 from smoogipoo/fix-beatmap-disposal

Fix disposal-related errors by making WorkingBeatmap non-disposable
This commit is contained in:
Dean Herbert
2020-02-13 18:52:47 +09:00
committed by GitHub
6 changed files with 61 additions and 54 deletions

View File

@ -401,15 +401,14 @@ namespace osu.Game
if (nextBeatmap?.Track != null)
nextBeatmap.Track.Completed += currentTrackCompleted;
using (var oldBeatmap = beatmap.OldValue)
{
if (oldBeatmap?.Track != null)
oldBeatmap.Track.Completed -= currentTrackCompleted;
}
var oldBeatmap = beatmap.OldValue;
if (oldBeatmap?.Track != null)
oldBeatmap.Track.Completed -= currentTrackCompleted;
updateModDefaults();
nextBeatmap?.LoadBeatmapAsync();
oldBeatmap?.CancelAsyncLoad();
nextBeatmap?.BeginAsyncLoad();
}
private void modsChanged(ValueChangedEvent<IReadOnlyList<Mod>> mods)