From dfd19187feb5a9e659cf95c07a86f1d2c1c07b27 Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Tue, 12 Nov 2013 18:34:37 +1300 Subject: [PATCH] Fix closure removal in Download.cs --- OpenRA.Game/Download.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenRA.Game/Download.cs b/OpenRA.Game/Download.cs index e69396235d..5955d3b588 100644 --- a/OpenRA.Game/Download.cs +++ b/OpenRA.Game/Download.cs @@ -21,7 +21,7 @@ namespace OpenRA public static string FormatErrorMessage(Exception e) { - var ex = e as System.Net.WebException; + var ex = e as WebException; if (ex == null) return e.Message; @@ -46,15 +46,15 @@ namespace OpenRA wc.DownloadProgressChanged += (_, a) => onProgress(a); wc.DownloadFileCompleted += (_, a) => onComplete(a, cancelled); - Game.OnQuit += () => Cancel(); - wc.DownloadFileCompleted += (_, a) => { Game.OnQuit -= () => Cancel(); }; + Game.OnQuit += Cancel; + wc.DownloadFileCompleted += (_, a) => { Game.OnQuit -= Cancel; }; wc.DownloadFileAsync(new Uri(url), path); } public void Cancel() { - Game.OnQuit -= () => Cancel(); + Game.OnQuit -= Cancel; wc.CancelAsync(); cancelled = true; }