Skip to content
Permalink
Browse files
Fix for collection dissappearing with the Light Groups patch
  • Loading branch information
juangea committed Aug 31, 2019
1 parent 778c80a commit ecf4d16
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
@@ -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);
@@ -234,7 +234,9 @@ 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);
/* take for example light group collections into account here, those are
* collections being referenced by a pointer property beneath a property group */
IDP_FreeProperty_ex(view_layer->id_properties, do_id_user);
}

MEM_SAFE_FREE(view_layer->object_bases_array);

0 comments on commit ecf4d16

Please sign in to comment.