From b3b075ea02034306256b486dd45410aa765f035a Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Thu, 12 Aug 2021 20:03:25 +0200 Subject: Fix segfault caused by shadow map on exit --- src/client/wieldmesh.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/wieldmesh.cpp b/src/client/wieldmesh.cpp index 7597aaa88..6beed3f3a 100644 --- a/src/client/wieldmesh.cpp +++ b/src/client/wieldmesh.cpp @@ -229,9 +229,9 @@ WieldMeshSceneNode::~WieldMeshSceneNode() { sanity_check(g_extrusion_mesh_cache); - // Remove node from shadow casters - if (m_shadow) - m_shadow->removeNodeFromShadowList(m_meshnode); + // Remove node from shadow casters. m_shadow might be an invalid pointer! + if (auto shadow = RenderingEngine::get_shadow_renderer()) + shadow->removeNodeFromShadowList(m_meshnode); if (g_extrusion_mesh_cache->drop()) g_extrusion_mesh_cache = nullptr; -- cgit v1.2.3