Skip to content

Commit

Permalink
Merge pull request #47038 from JFonS/fix_renderer_rid_crash
Browse files Browse the repository at this point in the history
[3.3] Fix crash in GLES3 renderer on release builds
  • Loading branch information
akien-mga authored Mar 22, 2021
2 parents c0b3ad2 + 8eb0306 commit a2dd778
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gles3/rasterizer_scene_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4961,6 +4961,11 @@ bool RasterizerSceneGLES3::free(RID p_rid) {

LightInstance *light_instance = light_instance_owner.getptr(p_rid);

// Make sure first_directional_light is invalidated
if (p_rid == first_directional_light) {
first_directional_light = RID();
}

//remove from shadow atlases..
for (Set<RID>::Element *E = light_instance->shadow_atlases.front(); E; E = E->next()) {
ShadowAtlas *shadow_atlas = shadow_atlas_owner.get(E->get());
Expand Down

0 comments on commit a2dd778

Please sign in to comment.