From e98bfec6444a0841558987d50938936562c6504c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 24 Oct 2017 11:40:38 +0900 Subject: [PATCH] Remove Thread.Sleep and tidy up new method --- osu.Game/OsuGame.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index cb502963f7..b8c197abc9 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -277,17 +277,7 @@ namespace osu.Game private void loadComponentSingleFile(T d, Action add) where T : Drawable { - Schedule(() => - { - if (asyncLoadStream != null) - asyncLoadStream = asyncLoadStream.ContinueWith(t => - { - Thread.Sleep(100); - LoadComponentAsync(d, add).Wait(); - }); - else - asyncLoadStream = LoadComponentAsync(d, add); - }); + Schedule(() => { asyncLoadStream = asyncLoadStream?.ContinueWith(t => LoadComponentAsync(d, add).Wait()) ?? LoadComponentAsync(d, add); }); } public bool OnPressed(GlobalAction action)