Skip to content

Commit

Permalink
Merge pull request #79884 from Dragoncraft89/master
Browse files Browse the repository at this point in the history
Vulkan: Fix dangling pointers in `_clean_up_swap_chain`
  • Loading branch information
YuriSizov committed Jul 25, 2023
2 parents a581bf0 + 7f7a2b2 commit 202e4b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/vulkan/vulkan_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,7 @@ Error VulkanContext::_clean_up_swap_chain(Window *window) {
fpDestroySwapchainKHR(device, window->swapchain, nullptr);
window->swapchain = VK_NULL_HANDLE;
vkDestroyRenderPass(device, window->render_pass, nullptr);
window->render_pass = VK_NULL_HANDLE;
if (window->swapchain_image_resources) {
for (uint32_t i = 0; i < swapchainImageCount; i++) {
vkDestroyImageView(device, window->swapchain_image_resources[i].view, nullptr);
Expand All @@ -1783,6 +1784,7 @@ Error VulkanContext::_clean_up_swap_chain(Window *window) {

free(window->swapchain_image_resources);
window->swapchain_image_resources = nullptr;
swapchainImageCount = 0;
}
if (separate_present_queue) {
vkDestroyCommandPool(device, window->present_cmd_pool, nullptr);
Expand Down

0 comments on commit 202e4b2

Please sign in to comment.