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

Commit 74967004 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

Change-Id: Iea63a324be09030e9cf25362472d74061d071225
parents 2a9d939d 31b85c23
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();