From 31bfa00d60de7692dfba293cc372d06bf8599088 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 27 Jul 2017 12:55:14 +0900 Subject: [PATCH] Schedule API callback to own scheduler Fixes race condition when API returns a failure after exiting song select. Note that the API does also schedule to the correct thread, but this schedule ensures the callback is never run, which is what we want in this case. --- osu.Game/Screens/Select/BeatmapDetails.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index 972d563ca5..dd5ba7b8ae 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -86,7 +86,7 @@ namespace osu.Game.Screens.Select requestedBeatmap.Metrics = res; Schedule(() => updateMetrics(res)); }; - lookup.Failure += e => updateMetrics(null); + lookup.Failure += e => Schedule(() => updateMetrics(null)); api.Queue(lookup); loading.Show();