aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2021-08-12 20:03:25 +0200
committerSmallJoker <mk939@ymail.com>2021-08-12 20:08:39 +0200
commitb3b075ea02034306256b486dd45410aa765f035a (patch)
tree48565efdab9fc660752e0a88a2940704db0d5821
parent47c146120a53735f8e75d5a1a3d077718811eeae (diff)
downloadminetest-b3b075ea02034306256b486dd45410aa765f035a.tar.gz
minetest-b3b075ea02034306256b486dd45410aa765f035a.tar.bz2
minetest-b3b075ea02034306256b486dd45410aa765f035a.zip
Fix segfault caused by shadow map on exit
-rw-r--r--src/client/wieldmesh.cpp6
1 files 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;