Skip to content

Commit

Permalink
Fix segfault caused by shadow map on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed Aug 12, 2021
1 parent 47c1461 commit b3b075e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/wieldmesh.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit b3b075e

Please sign in to comment.