1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:22:55 +08:00

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.
This commit is contained in:
Dean Herbert 2017-07-27 12:55:14 +09:00
parent d441a7a6f9
commit 31bfa00d60

View File

@ -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();