Merge branch 'master' into fix-startup-webrequests

This commit is contained in:
Dean Herbert 2018-08-30 14:43:29 +09:00 committed by GitHub
commit 2ff48da5af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -506,22 +506,24 @@ namespace osu.Game
// we could avoid the need for scheduling altogether. // we could avoid the need for scheduling altogether.
Schedule(() => Schedule(() =>
{ {
if (asyncLoadStream != null) var previousLoadStream = asyncLoadStream;
{
//chain with existing load stream //chain with existing load stream
asyncLoadStream = asyncLoadStream.ContinueWith(async t => asyncLoadStream = Task.Run(async () =>
{ {
if (previousLoadStream != null)
await previousLoadStream;
try try
{ {
Logger.Log($"Loading {d}...", LoggingTarget.Debug);
await LoadComponentAsync(d, add); await LoadComponentAsync(d, add);
Logger.Log($"Loaded {d}!", LoggingTarget.Debug);
} }
catch (OperationCanceledException) catch (OperationCanceledException)
{ {
} }
}); });
}
else
asyncLoadStream = LoadComponentAsync(d, add);
}); });
} }