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:
parent
6da854e37c
commit
08b79bb921
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user