vulkan/wsi/wayland: Fix proxy wrappers for swapchain recreation
authorPhilipp Zabel <philipp.zabel@gmail.com>
Fri, 19 May 2017 22:07:12 +0000 (00:07 +0200)
committerDaniel Stone <daniels@collabora.com>
Sat, 20 May 2017 16:00:08 +0000 (17:00 +0100)
commit1586768e7475a2732650f0ec2738b4e8429e4b40
treee19bc68311c74d95f77c53c2c2461d3a2e24ba6d
parent2b878cb8fdb99dd84602553c2e95ef47747f4529
vulkan/wsi/wayland: Fix proxy wrappers for swapchain recreation

Before the swapchain event queue is destroyed, all proxy objects that reference
it must be dropped. Otherwise we risk a use-after-free if a frame callback event
or buffer release events are received afterwards.
This happens when an application destroys and recreates a swapchain in FIFO
mode between two frames without using the VkSwapchainCreateInfoKHR::oldSwapchain
mechanism to keep the old swapchain until after the next redraw.

Fixes: 5034c615582a ("vulkan/wsi/wayland: Use proxy wrappers for swapchain")
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Cc: mesa-stable@lists.freedesktop.org
src/vulkan/wsi/wsi_common_wayland.c