Skip to content

Commit

Permalink
No longer execute BDL continuations synchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Oct 24, 2024
1 parent 9c6705e commit 75566d4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions osu.Framework/Graphics/Containers/CompositeDrawable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
using JetBrains.Annotations;
using osu.Framework.Development;
using osu.Framework.Extensions.EnumExtensions;
using osu.Framework.Extensions.ExceptionExtensions;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Layout;
using osu.Framework.Logging;
using osu.Framework.Utils;
using Exception = System.Exception;

namespace osu.Framework.Graphics.Containers
{
Expand Down Expand Up @@ -173,9 +173,18 @@ protected internal Task LoadComponentsAsync<TLoadable>(IEnumerable<TLoadable> co

var taskScheduler = loadables.Any(c => c.IsLongRunning) ? SCHEDULER_LONG_LOAD : SCHEDULER_STANDARD;

return Task.Factory.StartNew(() => loadComponents(loadables, deps, true, linkedSource.Token), linkedSource.Token, TaskCreationOptions.HideScheduler, taskScheduler).ContinueWith(loaded =>
return Task.Factory.StartNew(() =>
{
var exception = loaded.Exception?.AsSingular();
Exception exception = null;

try
{
loadComponents(loadables, deps, true, linkedSource.Token);
}
catch (Exception e)
{
exception = e;
}

if (loadables.Count == 0)
return;
Expand Down Expand Up @@ -205,7 +214,7 @@ protected internal Task LoadComponentsAsync<TLoadable>(IEnumerable<TLoadable> co
linkedSource.Dispose();
}
});
}, TaskContinuationOptions.ExecuteSynchronously);
}, linkedSource.Token, TaskCreationOptions.HideScheduler, taskScheduler);
}

/// <summary>
Expand Down

0 comments on commit 75566d4

Please sign in to comment.