Skip to content

Commit 4533cc5

Browse files
committed
Merge pull request godotengine#79884 from Dragoncraft89/master
Vulkan: Fix dangling pointers in `_clean_up_swap_chain`
2 parents 531a0c9 + 420db44 commit 4533cc5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/vulkan/vulkan_context.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,7 @@ Error VulkanContext::_clean_up_swap_chain(Window *window) {
17751775
fpDestroySwapchainKHR(device, window->swapchain, nullptr);
17761776
window->swapchain = VK_NULL_HANDLE;
17771777
vkDestroyRenderPass(device, window->render_pass, nullptr);
1778+
window->render_pass = VK_NULL_HANDLE;
17781779
if (window->swapchain_image_resources) {
17791780
for (uint32_t i = 0; i < swapchainImageCount; i++) {
17801781
vkDestroyImageView(device, window->swapchain_image_resources[i].view, nullptr);
@@ -1783,6 +1784,7 @@ Error VulkanContext::_clean_up_swap_chain(Window *window) {
17831784

17841785
free(window->swapchain_image_resources);
17851786
window->swapchain_image_resources = nullptr;
1787+
swapchainImageCount = 0;
17861788
}
17871789
if (separate_present_queue) {
17881790
vkDestroyCommandPool(device, window->present_cmd_pool, nullptr);

0 commit comments

Comments
 (0)