Fix errors when materials attached to 3d object are not freed
This commit is contained in:
parent
08e540a2ac
commit
8f57d9519e
|
@ -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>());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -188,6 +188,7 @@ public:
|
|||
|
||||
TypedArray<String> get_configuration_warnings() const override;
|
||||
GeometryInstance3D();
|
||||
virtual ~GeometryInstance3D();
|
||||
};
|
||||
|
||||
VARIANT_ENUM_CAST(GeometryInstance3D::ShadowCastingSetting);
|
||||
|
|
Loading…
Reference in New Issue