Fix errors when materials attached to 3d object are not freed
This commit is contained in:
parent
08e540a2ac
commit
8f57d9519e
2 changed files with 10 additions and 0 deletions
|
|
@ -496,3 +496,12 @@ void GeometryInstance3D::_bind_methods() {
|
|||
GeometryInstance3D::GeometryInstance3D() {
|
||||
//RS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0);
|
||||
}
|
||||
|
||||
GeometryInstance3D::~GeometryInstance3D() {
|
||||
if (material_overlay.is_valid()) {
|
||||
set_material_overlay(Ref<Material>());
|
||||
}
|
||||
if (material_override.is_valid()) {
|
||||
set_material_override(Ref<Material>());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue