Fix cancellation of downloads.

The Download class cancels asynchronously, which means callers must handle cancellation inside the completion event, and not after requesting cancellation.
This commit is contained in:
RoosterDragon
2016-07-30 16:27:45 +01:00
parent 77d0a8c54e
commit 3b5798b5e8
6 changed files with 61 additions and 55 deletions

View File

@@ -294,8 +294,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
.JoinWith("&");
new Download(newsURL, cacheFile, e => { },
(e, c) => NewsDownloadComplete(e, cacheFile, currentNews,
() => newsButton.AttachPanel(newsPanel)));
e => NewsDownloadComplete(e, cacheFile, currentNews,
() => newsButton.AttachPanel(newsPanel)));
}
newsButton.OnClick = () => newsButton.AttachPanel(newsPanel);