Merge pull request #55701 from lawnjelly/fix_gles2_env_leak

This commit is contained in:
Rémi Verschelde 2021-12-07 20:07:15 +01:00 committed by GitHub
commit 7ac92d2bc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
@ -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;
}