From dfd6a1820d3216a39f0d83657c8136a969ff3f12 Mon Sep 17 00:00:00 2001 From: Benau Date: Sat, 2 Jul 2022 10:52:20 +0800 Subject: [PATCH] Fix crash when closing in RTT screen --- lib/graphics_engine/src/ge_vulkan_driver.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/graphics_engine/src/ge_vulkan_driver.cpp b/lib/graphics_engine/src/ge_vulkan_driver.cpp index 9a75f1e54..116afce17 100644 --- a/lib/graphics_engine/src/ge_vulkan_driver.cpp +++ b/lib/graphics_engine/src/ge_vulkan_driver.cpp @@ -9,6 +9,7 @@ #include "ge_vulkan_texture.hpp" #include "ge_vulkan_command_loader.hpp" +#include "ICameraSceneNode.h" #include "ISceneManager.h" #include "IrrlichtDevice.h" @@ -586,6 +587,12 @@ void GEVulkanDriver::destroyVulkan() m_transparent_texture = NULL; } + if (m_irrlicht_device->getSceneManager() && + m_irrlicht_device->getSceneManager()->getActiveCamera()) + { + m_irrlicht_device->getSceneManager()->setActiveCamera(NULL); + } + if (m_irrlicht_device->getSceneManager() && m_irrlicht_device->getSceneManager()->getMeshCache()) getVulkanMeshCache()->destroy();