Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-12-26 18:31:45 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-12-26 18:31:48 +0300
commitbd80ace2da72256801ca7579ca92cf4fe7a6a513 (patch)
tree9aa1285bb5db88e3b61e71891509b2b08d2c124d /source/blender/blenkernel/intern/freestyle.c
parentfe1e2c2f89b54302b213621f6ffd2b6089016155 (diff)
Depsgraph: Fix copy-on-write assert when freeing Freestyle config
We were bumping user count when duplicating viewlayer and its freestyleconfig depending on the flag, however when freeing we were always decreasing user count. This fixes this and get rid of the assert when running: `--factory-startup --enable-copy-on-write` And closing Blender.
Diffstat (limited to 'source/blender/blenkernel/intern/freestyle.c')
-rw-r--r--source/blender/blenkernel/intern/freestyle.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/freestyle.c b/source/blender/blenkernel/intern/freestyle.c
index 686fe3bda93..b656d2cf7c0 100644
--- a/source/blender/blenkernel/intern/freestyle.c
+++ b/source/blender/blenkernel/intern/freestyle.c
@@ -61,17 +61,21 @@ void BKE_freestyle_config_init(FreestyleConfig *config)
BLI_listbase_clear(&config->linesets);
}
-void BKE_freestyle_config_free(FreestyleConfig *config)
+void BKE_freestyle_config_free(FreestyleConfig *config, const bool do_id_user)
{
FreestyleLineSet *lineset;
for (lineset = (FreestyleLineSet *)config->linesets.first; lineset; lineset = lineset->next) {
if (lineset->group) {
- id_us_min(&lineset->group->id);
+ if (do_id_user) {
+ id_us_min(&lineset->group->id);
+ }
lineset->group = NULL;
}
if (lineset->linestyle) {
- id_us_min(&lineset->linestyle->id);
+ if (do_id_user) {
+ id_us_min(&lineset->linestyle->id);
+ }
lineset->linestyle = NULL;
}
}