Fix T71250: ID user decrement error with ID properties in ViewLayer
Credit for the original patch goes to @scorpion81.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user