1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 16:32:54 +08:00

Merge pull request #3330 from peppy/fix-single-file-loading

Fix single file component loading not actually working correctly
This commit is contained in:
Dean Herbert 2018-08-30 14:42:39 +09:00 committed by GitHub
commit 91a8039829
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.
Schedule(() =>
{
if (asyncLoadStream != null)
var previousLoadStream = asyncLoadStream;
//chain with existing load stream
asyncLoadStream = Task.Run(async () =>
{
//chain with existing load stream
asyncLoadStream = asyncLoadStream.ContinueWith(async t =>
if (previousLoadStream != null)
await previousLoadStream;
try
{
try
{
await LoadComponentAsync(d, add);
}
catch (OperationCanceledException)
{
}
});
}
else
asyncLoadStream = LoadComponentAsync(d, add);
Logger.Log($"Loading {d}...", LoggingTarget.Debug);
await LoadComponentAsync(d, add);
Logger.Log($"Loaded {d}!", LoggingTarget.Debug);
}
catch (OperationCanceledException)
{
}
});
});
}