1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Some globals (un-)init fixes

This commit is contained in:
sfan5 2024-04-11 13:54:09 +02:00
parent 2af5191070
commit d8190e1c5f
16 changed files with 58 additions and 62 deletions

View file

@ -253,8 +253,11 @@ RenderingEngine::RenderingEngine(IEventReceiver *receiver)
RenderingEngine::~RenderingEngine()
{
sanity_check(s_singleton == this);
core.reset();
m_device->closeDevice();
m_device->drop();
s_singleton = nullptr;
}
@ -278,10 +281,7 @@ void RenderingEngine::removeMesh(const scene::IMesh* mesh)
void RenderingEngine::cleanupMeshCache()
{
auto mesh_cache = m_device->getSceneManager()->getMeshCache();
while (mesh_cache->getMeshCount() != 0) {
if (scene::IAnimatedMesh *mesh = mesh_cache->getMeshByIndex(0))
mesh_cache->removeMesh(mesh);
}
mesh_cache->clear();
}
bool RenderingEngine::setupTopLevelWindow()