Fix mismatched alloc/free in Swapchain The swapchain images were being freed with an allocator despite never being created with one. Tests: dEQP-VK.wsi.xlib.swapchain.simulate_oom.* Bug: b/132451407 Change-Id: I26c6ecd18d04f514cdae171100de6a89c919a777 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31692 Presubmit-Ready: Ben Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: Chris Forbes <chrisforbes@google.com> Tested-by: Hernan Liatis <hliatis@google.com>
diff --git a/src/WSI/VkSwapchainKHR.cpp b/src/WSI/VkSwapchainKHR.cpp index 672be09..30c72a9 100644 --- a/src/WSI/VkSwapchainKHR.cpp +++ b/src/WSI/VkSwapchainKHR.cpp
@@ -38,8 +38,8 @@ if (currentImage.imageStatus != NONEXISTENT) { vk::Cast(createInfo.surface)->detachImage(¤tImage); - vk::destroy(currentImage.imageMemory, pAllocator); - vk::destroy(currentImage.image, pAllocator); + vk::destroy(currentImage.imageMemory, nullptr); + vk::destroy(currentImage.image, nullptr); currentImage.imageStatus = NONEXISTENT; }