remove a pointer from ptrToSlotIndex when it is released
authorJeannot Breton <jbreton@nvidia.com>
Wed, 13 Jan 2016 03:12:45 +0000 (21:12 -0600)
committerJeannot Breton <jbreton@nvidia.com>
Wed, 13 Jan 2016 03:12:45 +0000 (21:12 -0600)
external/vulkancts/framework/vulkan/vkAllocationCallbackUtil.cpp

index 59e965b..97a6bfd 100644 (file)
@@ -480,8 +480,11 @@ void validateAllocationCallbacks (const AllocationCallbackRecorder& recorder, Al
                                        {
                                                const size_t    slotNdx         = ptrToSlotIndex[record.data.free.mem];
 
-                                               if (allocations[slotNdx].isLive)
+                                               if (allocations[slotNdx].isLive) 
+                                               {
                                                        allocations[slotNdx].isLive = false;
+                                                       ptrToSlotIndex.erase(record.data.free.mem);
+                                               }
                                                else
                                                        results->violations.push_back(AllocationCallbackViolation(record, AllocationCallbackViolation::REASON_DOUBLE_FREE));
                                        }