From 7a6479163eb463eb3dca301c783c6d6b21eb1944 Mon Sep 17 00:00:00 2001 From: SamHurne Date: Mon, 29 Jun 2015 18:04:34 -0400 Subject: [PATCH] Fixed deadlock --- GW2PAO/Modules/ZoneCompletion/ZoneCompletionController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GW2PAO/Modules/ZoneCompletion/ZoneCompletionController.cs b/GW2PAO/Modules/ZoneCompletion/ZoneCompletionController.cs index cf3a6f9..bf8f132 100644 --- a/GW2PAO/Modules/ZoneCompletion/ZoneCompletionController.cs +++ b/GW2PAO/Modules/ZoneCompletion/ZoneCompletionController.cs @@ -247,9 +247,9 @@ private void RefreshZone(object state = null) this.CharacterName = this.playerService.CharacterName; var zoneItems = this.zoneService.GetZoneItems(this.playerService.MapId); - Threading.InvokeOnUI(() => + lock (zoneItemsLock) { - lock (zoneItemsLock) + Threading.InvokeOnUI(() => { this.ZoneItems.Clear(); this.distanceCounters.Clear(); @@ -262,8 +262,8 @@ private void RefreshZone(object state = null) this.distanceCounters.Add(item.ID, 0); } } - } - }); + }); + } // Update the current zone name var newZoneName = this.zoneService.GetZoneName(this.CurrentMapID);