Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leaking environment RIDs in GLES2 #55701

Merged
merged 1 commit into from
Dec 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions drivers/gles2/rasterizer_scene_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3875,6 +3875,7 @@ bool RasterizerSceneGLES2::free(RID p_rid) {
shadow_atlas_set_size(p_rid, 0);
shadow_atlas_owner.free(p_rid);
memdelete(shadow_atlas);

} else if (reflection_probe_instance_owner.owns(p_rid)) {
ReflectionProbeInstance *reflection_instance = reflection_probe_instance_owner.get(p_rid);

Expand All @@ -3892,6 +3893,12 @@ bool RasterizerSceneGLES2::free(RID p_rid) {
reflection_probe_instance_owner.free(p_rid);
memdelete(reflection_instance);

} else if (environment_owner.owns(p_rid)) {
Environment *environment = environment_owner.get(p_rid);

environment_owner.free(p_rid);
memdelete(environment);

} else {
return false;
}
Expand Down