Fix crossthread operations due to Track.Completed

This commit is contained in:
smoogipoo 2019-02-27 16:52:34 +09:00
parent 109abf4d28
commit 30815ace62
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ public abstract class PreviewTrack : Component
private void load() private void load()
{ {
track = GetTrack(); track = GetTrack();
track.Completed += Stop; track.Completed += () => Schedule(Stop);
} }
/// <summary> /// <summary>

View File

@ -351,11 +351,11 @@ private void beatmapChanged(ValueChangedEvent<WorkingBeatmap> beatmap)
queuedDirection = null; queuedDirection = null;
} }
private void currentTrackCompleted() private void currentTrackCompleted() => Schedule(() =>
{ {
if (!beatmap.Disabled && beatmapSets.Any()) if (!beatmap.Disabled && beatmapSets.Any())
next(); next();
} });
private ScheduledDelegate pendingBeatmapSwitch; private ScheduledDelegate pendingBeatmapSwitch;