diff options
author | SmallJoker <mk939@ymail.com> | 2021-08-12 20:03:25 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2021-08-12 20:08:39 +0200 |
commit | b3b075ea02034306256b486dd45410aa765f035a (patch) | |
tree | 48565efdab9fc660752e0a88a2940704db0d5821 /src/client | |
parent | 47c146120a53735f8e75d5a1a3d077718811eeae (diff) | |
download | minetest-b3b075ea02034306256b486dd45410aa765f035a.tar.gz minetest-b3b075ea02034306256b486dd45410aa765f035a.tar.bz2 minetest-b3b075ea02034306256b486dd45410aa765f035a.zip |
Fix segfault caused by shadow map on exit
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/wieldmesh.cpp | 6 |
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; |