diff --git a/lib/graphics_engine/src/ge_vulkan_2d_renderer.cpp b/lib/graphics_engine/src/ge_vulkan_2d_renderer.cpp index 5a8748e88..91ad18a9a 100644 --- a/lib/graphics_engine/src/ge_vulkan_2d_renderer.cpp +++ b/lib/graphics_engine/src/ge_vulkan_2d_renderer.cpp @@ -72,6 +72,8 @@ void GEVulkan2dRenderer::destroy() delete g_tris_index_buffer; g_tris_index_buffer = NULL; + if (!g_vk) + return; vkDestroyDescriptorSetLayout(g_vk->getDevice(), g_descriptor_set_layout, NULL); vkDestroyDescriptorPool(g_vk->getDevice(), g_descriptor_pool, NULL); diff --git a/lib/graphics_engine/src/ge_vulkan_driver.cpp b/lib/graphics_engine/src/ge_vulkan_driver.cpp index bf055dd06..9a75f1e54 100644 --- a/lib/graphics_engine/src/ge_vulkan_driver.cpp +++ b/lib/graphics_engine/src/ge_vulkan_driver.cpp @@ -561,7 +561,8 @@ GEVulkanDriver::GEVulkanDriver(const SIrrlichtCreationParameters& params, catch (std::exception& e) { destroyVulkan(); - throw std::runtime_error("GEVulkanDriver constructor failed"); + throw std::runtime_error(std::string( + "GEVulkanDriver constructor failed: ") + e.what()); } } // GEVulkanDriver @@ -585,7 +586,9 @@ void GEVulkanDriver::destroyVulkan() m_transparent_texture = NULL; } - getVulkanMeshCache()->destroy(); + if (m_irrlicht_device->getSceneManager() && + m_irrlicht_device->getSceneManager()->getMeshCache()) + getVulkanMeshCache()->destroy(); GEVulkan2dRenderer::destroy(); GEVulkanShaderManager::destroy();