Fix errors on quitting from an empty project

This commit is contained in:
Yuri Roubinsky 2021-10-18 14:23:10 +03:00
parent 523e0d80a8
commit 26a26d6657
3 changed files with 6 additions and 2 deletions

View file

@ -292,7 +292,6 @@ ProceduralSkyMaterial::ProceduralSkyMaterial() {
}
ProceduralSkyMaterial::~ProceduralSkyMaterial() {
RS::get_singleton()->material_set_shader(_get_material(), RID());
}
/////////////////////////////////////////
@ -368,7 +367,6 @@ PanoramaSkyMaterial::PanoramaSkyMaterial() {
}
PanoramaSkyMaterial::~PanoramaSkyMaterial() {
RS::get_singleton()->material_set_shader(_get_material(), RID());
}
//////////////////////////////////

View file

@ -1781,6 +1781,11 @@ void RendererSceneRenderRD::_free_render_buffer_data(RenderBuffers *rb) {
rb->ambient_buffer = RID();
rb->reflection_buffer = RID();
}
if (rb->gi.voxel_gi_buffer.is_valid()) {
RD::get_singleton()->free(rb->gi.voxel_gi_buffer);
rb->gi.voxel_gi_buffer = RID();
}
}
void RendererSceneRenderRD::_process_sss(RID p_render_buffers, const CameraMatrix &p_camera) {

View file

@ -576,6 +576,7 @@ void RendererSceneSkyRD::Sky::free(RendererStorageRD *p_storage) {
if (material.is_valid()) {
p_storage->free(material);
material = RID();
}
}