From 47e5c2f8499e30906c4fbeef3cb5336f4fb2da45 Mon Sep 17 00:00:00 2001 From: Josef Nemec Date: Wed, 29 Dec 2021 11:17:55 +0100 Subject: [PATCH] Fix: Application deadlock when starting add-on installation externally --- source/Playnite/Common/Web/Downloader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Playnite/Common/Web/Downloader.cs b/source/Playnite/Common/Web/Downloader.cs index 84911d828..3b36254b3 100644 --- a/source/Playnite/Common/Web/Downloader.cs +++ b/source/Playnite/Common/Web/Downloader.cs @@ -77,7 +77,7 @@ public string DownloadString(string url, CancellationToken cancelToken) using (var webClient = new WebClient { Encoding = Encoding.UTF8 }) using (var registration = cancelToken.Register(() => webClient.CancelAsync())) { - return webClient.DownloadStringTaskAsync(url).GetAwaiter().GetResult(); + return Task.Run(async () => await webClient.DownloadStringTaskAsync(url)).GetAwaiter().GetResult(); } } catch (WebException ex) when (ex.Status == WebExceptionStatus.RequestCanceled)