From 112d4a1cb8e5f091c8c94c71b84e14803f8cd2ac Mon Sep 17 00:00:00 2001 From: BrendanLoBuglio Date: Tue, 15 Jan 2019 14:14:29 -0800 Subject: [PATCH] Moved the callback for async requests to happen after the task is fully cleaned up (i.e. owner removed from task owner list), fixing a bug where asking for a new path in the callback of an old path would cause an error. --- Source/DonAINavigation/Private/DonNavigationManager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/DonAINavigation/Private/DonNavigationManager.cpp b/Source/DonAINavigation/Private/DonNavigationManager.cpp index f4d322a..289977b 100644 --- a/Source/DonAINavigation/Private/DonNavigationManager.cpp +++ b/Source/DonAINavigation/Private/DonNavigationManager.cpp @@ -148,9 +148,8 @@ void ADonNavigationManager::ReceiveAsyncResults() { FDonNavigationQueryTask task; CompletedNavigationTasks.Dequeue(task); - task.BroadcastResult(); - ActiveNavigationTaskOwners.Remove(task.Data.Actor.Get()); + task.BroadcastResult(); #if DEBUG_DoNAI_THREADS auto owner = task.Data.Actor.Get();