From 5fff54e8046f913fc0f4e5e8cb94a8018658e2a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 29 Nov 2017 19:15:08 +0100 Subject: [PATCH] Fix another possible Vulkan shutdown bug --- GPU/Vulkan/DrawEngineVulkan.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/GPU/Vulkan/DrawEngineVulkan.cpp b/GPU/Vulkan/DrawEngineVulkan.cpp index 82908e0048..73fb6afe4e 100644 --- a/GPU/Vulkan/DrawEngineVulkan.cpp +++ b/GPU/Vulkan/DrawEngineVulkan.cpp @@ -247,9 +247,11 @@ void DrawEngineVulkan::DestroyDeviceObjects() { delete nullTexture_; nullTexture_ = nullptr; } - vertexCache_->Destroy(vulkan_); - delete vertexCache_; - vertexCache_ = nullptr; + if (vertexCache_) { + vertexCache_->Destroy(vulkan_); + delete vertexCache_; + vertexCache_ = nullptr; + } // Need to clear this to get rid of all remaining references to the dead buffers. vai_.Iterate([](uint32_t hash, VertexArrayInfoVulkan *vai) { delete vai;