Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 121b68bc authored by Chris Forbes's avatar Chris Forbes Committed by android-build-merger
Browse files

Fix cleanup of swapchain images in the shared case am: 31b85c23

am: 74967004

Change-Id: I8cbe70f51fa999ab41548b3ba3fa835ba013de91
parents 545ae585 74967004
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1268,21 +1268,21 @@ VkResult CreateSwapchainKHR(VkDevice device,
    //
    // TODO(jessehall): The error path here is the same as DestroySwapchain,
    // but not the non-error path. Should refactor/unify.
    if (!swapchain->shared) {
    for (uint32_t i = 0; i < num_images; i++) {
        Swapchain::Image& img = swapchain->images[i];
        if (img.dequeued) {
            if (!swapchain->shared) {
                surface.window->cancelBuffer(surface.window.get(), img.buffer.get(),
                                             img.dequeue_fence);
                img.dequeue_fence = -1;
                img.dequeued = false;
            }
        }
        if (result != VK_SUCCESS) {
            if (img.image)
                dispatch.DestroyImage(device, img.image, nullptr);
        }
    }
    }

    if (result != VK_SUCCESS) {
        swapchain->~Swapchain();