mirror of https://github.com/ppy/osu
Wait for two update frames before attempting to migrate storage
This commit is contained in:
parent
dd7c3dbc5b
commit
835c8d74b7
|
@ -272,8 +272,16 @@ private OsuGameBase loadOsu(GameHost host)
|
|||
{
|
||||
var osu = new OsuGameBase();
|
||||
Task.Run(() => host.Run(osu));
|
||||
|
||||
waitForOrAssert(() => osu.IsLoaded, @"osu! failed to start in a reasonable amount of time");
|
||||
|
||||
bool ready = false;
|
||||
// wait for two update frames to be executed. this ensures that all components have had a change to run LoadComplete and hopefully avoid
|
||||
// database access (GlobalActionContainer is one to do this).
|
||||
host.UpdateThread.Scheduler.Add(() => host.UpdateThread.Scheduler.Add(() => ready = true));
|
||||
|
||||
waitForOrAssert(() => ready, @"osu! failed to start in a reasonable amount of time");
|
||||
|
||||
return osu;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue