mem_tracker: Check for fence before retiring
authorCourtney Goeltzenleuchter <courtney@LunarG.com>
Wed, 15 Apr 2015 20:10:51 +0000 (14:10 -0600)
committerChia-I Wu <olv@lunarg.com>
Thu, 16 Apr 2015 09:48:20 +0000 (17:48 +0800)
layers/mem_tracker.cpp

index 1ea4f69..8394bc8 100644 (file)
@@ -209,9 +209,8 @@ static void updateFenceTracking(VkFence fence)
 static bool32_t fenceRetired(uint64_t fenceId)
 {
     bool32_t result = VK_FALSE;
-    MT_FENCE_INFO* pFenceInfo = fenceMap[fenceId];
-    if (pFenceInfo != 0)
-    {
+    if (fenceMap.find(fenceId) != fenceMap.end()) {
+        MT_FENCE_INFO* pFenceInfo = fenceMap[fenceId];
         MT_QUEUE_INFO* pQueueInfo = queueMap[pFenceInfo->queue];
         if (fenceId <= pQueueInfo->lastRetiredId)
         {