Fix T71250: ID user decrement error with ID properties in ViewLayer

Credit for the original patch goes to @scorpion81.
This commit is contained in:
2019-11-04 15:02:03 +01:00
parent 3f3d1ad480
commit ece4515fc8
3 changed files with 8 additions and 1 deletions

View File

@@ -136,6 +136,7 @@ struct IDProperty *IDP_New(const char type,
void IDP_FreePropertyContent_ex(struct IDProperty *prop, const bool do_id_user);
void IDP_FreePropertyContent(struct IDProperty *prop);
void IDP_FreeProperty_ex(IDProperty *prop, const bool do_id_user);
void IDP_FreeProperty(struct IDProperty *prop);
void IDP_ClearProperty(IDProperty *prop);

View File

@@ -1085,6 +1085,12 @@ void IDP_FreePropertyContent(IDProperty *prop)
IDP_FreePropertyContent_ex(prop, true);
}
void IDP_FreeProperty_ex(IDProperty *prop, const bool do_id_user)
{
IDP_FreePropertyContent_ex(prop, do_id_user);
MEM_freeN(prop);
}
void IDP_FreeProperty(IDProperty *prop)
{
IDP_FreePropertyContent(prop);

View File

@@ -239,7 +239,7 @@ void BKE_view_layer_free_ex(ViewLayer *view_layer, const bool do_id_user)
BKE_freestyle_config_free(&view_layer->freestyle_config, do_id_user);
if (view_layer->id_properties) {
IDP_FreeProperty(view_layer->id_properties);
IDP_FreeProperty_ex(view_layer->id_properties, do_id_user);
}
MEM_SAFE_FREE(view_layer->object_bases_array);