From da180a1c4fb9d6632a1c2dd02e4724be5257e608 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 7 Jul 2020 00:59:42 +1000 Subject: [PATCH] Vulkan: Fix crash when device creation fails --- src/common/vulkan/context.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/vulkan/context.cpp b/src/common/vulkan/context.cpp index 3b0a6f101..a9b932edb 100644 --- a/src/common/vulkan/context.cpp +++ b/src/common/vulkan/context.cpp @@ -39,7 +39,9 @@ Context::Context(VkInstance instance, VkPhysicalDevice physical_device, bool own Context::~Context() { - WaitForGPUIdle(); + if (m_device != VK_NULL_HANDLE) + WaitForGPUIdle(); + DestroyRenderPassCache(); DestroyGlobalDescriptorPool(); DestroyCommandBuffers();