Fix crash when closing in RTT screen

This commit is contained in:
Benau 2022-07-02 10:52:20 +08:00
parent dc168e1b13
commit dfd6a1820d

View File

@ -9,6 +9,7 @@
#include "ge_vulkan_texture.hpp" #include "ge_vulkan_texture.hpp"
#include "ge_vulkan_command_loader.hpp" #include "ge_vulkan_command_loader.hpp"
#include "ICameraSceneNode.h"
#include "ISceneManager.h" #include "ISceneManager.h"
#include "IrrlichtDevice.h" #include "IrrlichtDevice.h"
@ -586,6 +587,12 @@ void GEVulkanDriver::destroyVulkan()
m_transparent_texture = NULL; 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() && if (m_irrlicht_device->getSceneManager() &&
m_irrlicht_device->getSceneManager()->getMeshCache()) m_irrlicht_device->getSceneManager()->getMeshCache())
getVulkanMeshCache()->destroy(); getVulkanMeshCache()->destroy();