diff --git a/gapis/api/vulkan/api/instance.api b/gapis/api/vulkan/api/instance.api index 4c93828b8a..fdf2f00bab 100644 --- a/gapis/api/vulkan/api/instance.api +++ b/gapis/api/vulkan/api/instance.api @@ -81,7 +81,9 @@ cmd void vkDestroyInstance( AllocationCallbacks pAllocator) { delete(Instances, instance) for _, device, _ in PhysicalDevices { - delete(PhysicalDevices, device) + if (PhysicalDevices[device].Instance == instance) { + delete(PhysicalDevices, device) + } } } diff --git a/gapis/api/vulkan/synthetic.api b/gapis/api/vulkan/synthetic.api index 958722ba11..72a953881b 100644 --- a/gapis/api/vulkan/synthetic.api +++ b/gapis/api/vulkan/synthetic.api @@ -38,7 +38,9 @@ cmd void replayDestroyVkInstance( // vkDestroyInstance() in vulkan.api. Change both together delete(Instances, instance) for _, device, _ in PhysicalDevices { - delete(PhysicalDevices, device) + if (PhysicalDevices[device].Instance == instance) { + delete(PhysicalDevices, device) + } } }