Commit f988cb53 by Hernan Liatis

Fix memory leak in vkDestroyImage

When swapchain images were being destroyed on Android, the backing memory was not being destroyed, causing a crash. Tests: dEQP-VK.wsi.android.swapchain.create.min_image_count Bug: 133346002 Change-Id: Ib2383a6c41ac2917f6e6630eca96e5c180996507 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31870Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarHernan Liatis <hliatis@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 29364a05
......@@ -1053,6 +1053,16 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyImage(VkDevice device, VkImage image, const
device, image.get(), pAllocator);
vk::destroy(image, pAllocator);
#ifdef __ANDROID__
auto it = androidSwapchainMap.find(image);
if (it != androidSwapchainMap.end())
{
vk::destroy((it->second).imageMemory, nullptr);
androidSwapchainMap.erase(it);
}
#endif
}
VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment