mirror of
https://github.com/stenzek/duckstation.git
synced 2025-07-22 01:50:06 +00:00
VulkanDevice: Fix crash on shutdown if swapchain creation fails
This commit is contained in:
parent
e0877c1922
commit
1bf076c74f
@ -1995,8 +1995,11 @@ 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.
|
||||
if (!CreateDevice(swap_chain ? swap_chain->GetSurface() : VK_NULL_HANDLE, enable_validation_layer, disabled_features,
|
||||
|
Loading…
x
Reference in New Issue
Block a user