Fix leaking environment RIDs in GLES2
This PR adds the code necessary to correctly free environments in GLES2, which was previously missing causing them to leak.
This commit is contained in:
parent
98e0ebfc4b
commit
7134ef90bb
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue