diff options
| author | Gabríel Arthúr Pétursson <gabriel@system.is> | 2017-06-03 23:33:57 +0000 |
|---|---|---|
| committer | Chris Forbes <chrisf@ijw.co.nz> | 2017-06-07 14:57:20 -0700 |
| commit | 892c2949ed7f668435aa55c6d13f76764b61298d (patch) | |
| tree | 2c161364b5a3c3ef44ba86b66660d88e16f136e2 /layers/object_tracker.cpp | |
| parent | 900135556fce1ecf6793267d4db4b423d7f009c1 (diff) | |
| download | usermoji-892c2949ed7f668435aa55c6d13f76764b61298d.tar.xz | |
layers: Destroy physical devices in object tracker's vkDestroyInstance
The objects are allocated in EnumeratePhysicalDevices, but were never
destroyed after use.
Diffstat (limited to 'layers/object_tracker.cpp')
| -rw-r--r-- | layers/object_tracker.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/layers/object_tracker.cpp b/layers/object_tracker.cpp index 9702c6a7..775b3b28 100644 --- a/layers/object_tracker.cpp +++ b/layers/object_tracker.cpp @@ -398,6 +398,16 @@ VKAPI_ATTR void VKAPI_CALL DestroyInstance(VkInstance instance, const VkAllocati // TODO: The instance handle can not be validated here. The loader will likely have to validate it. ValidateObject(instance, instance, kVulkanObjectTypeInstance, true, VALIDATION_ERROR_2580bc01, VALIDATION_ERROR_UNDEFINED); + // Destroy physical devices + for (auto iit = instance_data->object_map[kVulkanObjectTypePhysicalDevice].begin(); + iit != instance_data->object_map[kVulkanObjectTypePhysicalDevice].end();) { + OBJTRACK_NODE *pNode = iit->second; + + VkPhysicalDevice physical_device = reinterpret_cast<VkPhysicalDevice>(pNode->handle); + DestroyObject(instance, physical_device, kVulkanObjectTypePhysicalDevice, nullptr, VALIDATION_ERROR_UNDEFINED, VALIDATION_ERROR_UNDEFINED); + iit = instance_data->object_map[kVulkanObjectTypePhysicalDevice].begin(); + } + DestroyObject(instance, instance, kVulkanObjectTypeInstance, pAllocator, VALIDATION_ERROR_258004ec, VALIDATION_ERROR_258004ee); // Report any remaining objects in LL |
