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

@@ -296,11 +296,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
searchStatus = SearchStatus.Fetching;
Action<DownloadDataCompletedEventArgs, bool> onComplete = (i, cancelled) =>
Action<DownloadDataCompletedEventArgs> onComplete = i =>
{
currentQuery = null;
if (i.Error != null || cancelled)
if (i.Error != null)
{
RefreshServerListInner(null);
return;