Skip to content

Commit

Permalink
VulkanDevice: Fix crash on shutdown if swapchain creation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Dec 31, 2024
1 parent e0877c1 commit 1bf076c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/util/vulkan_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,10 @@ bool VulkanDevice::CreateDeviceAndMainSwapChain(std::string_view adapter, Featur
swap_chain =
std::make_unique<VulkanSwapChain>(wi, vsync_mode, allow_present_throttle, exclusive_fullscreen_control);
if (!swap_chain->CreateSurface(m_instance, m_physical_device, error))
{
swap_chain->Destroy(*this, false);
return false;
}
}

// Attempt to create the device.
Expand Down

0 comments on commit 1bf076c

Please # to comment.