diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-10-12 16:54:43 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-10-12 16:54:43 +0300 |
commit | a51688d0b066f00d5912d677d0f4bdad08b28ea6 (patch) | |
tree | aa4ed2f62e238cc4103e9b1969a88fbf3431c6b1 /source/blender/blenkernel/intern | |
parent | 3b4f6996a8fd521b532eff0f8cbcd282d9a2c5b7 (diff) |
Fix T53052: ID decrement error when deleting a scene, either python or GUI.
User count of scenes was inconsistant, screens only have 'user_one' kind
of owning over scenes, which means they shall never increment or
decrement their real user count. And usually, scenes have no real user
at all.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index d32a3a293fd..4526477cad9 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -290,7 +290,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type) ListBase rl, rv; sce_copy = BKE_scene_add(bmain, sce->id.name + 2); - + rl = sce_copy->r.layers; rv = sce_copy->r.views; curvemapping_free_data(&sce_copy->r.mblur_shutter_curve); @@ -387,6 +387,8 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type) } else { BKE_id_copy_ex(bmain, (ID *)sce, (ID **)&sce_copy, LIB_ID_COPY_ACTIONS, false); + id_us_min(&sce_copy->id); + id_us_ensure_real(&sce_copy->id); /* Extra actions, most notably SCE_FULL_COPY also duplicates several 'children' datablocks... */ |