1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Store and return unstarted task for consumers to await on.

This commit is contained in:
Lucas A 2020-12-12 17:12:15 +01:00
parent 6da854e37c
commit 08b79bb921

View File

@ -429,8 +429,9 @@ namespace osu.Game
public override Task Import(Stream stream, string filename)
{
WaitForReady(() => this, _ => Task.Run(() => base.Import(stream, filename)));
return Task.CompletedTask;
var importTask = new Task(async () => await base.Import(stream, filename));
WaitForReady(() => this, _ => importTask.Start());
return importTask;
}
protected virtual Loader CreateLoader() => new Loader();