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/editors/screen/screen_edit.c | |
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/editors/screen/screen_edit.c')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 71b00a0a7c6..c99e452b755 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1763,7 +1763,10 @@ bool ED_screen_delete_scene(bContext *C, Scene *scene) BKE_libblock_remap(bmain, scene, newscene, ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_NEVER_NULL_USAGE); - BKE_libblock_free_us(bmain, scene); + id_us_clear_real(&scene->id); + if (scene->id.us == 0) { + BKE_libblock_free(bmain, scene); + } return true; } |