diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-10-12 17:50:53 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-10-12 17:50:53 +0300 |
commit | e416f417e095397f37297471061d911927597fac (patch) | |
tree | 5dd888d108367aa8cf4f760524e008b133ff7717 /source/blender/editors/scene | |
parent | 557dc7d34353992058451851a6ec1068d25b13d4 (diff) |
Fix scene deletion code to match master's behavior.
Previous code, while more correct than old master one, could still lead
to invalid state in some corner cases (like linked scenes...).
Diffstat (limited to 'source/blender/editors/scene')
-rw-r--r-- | source/blender/editors/scene/scene_edit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c index 00a56f3dbc7..0ac883d38ca 100644 --- a/source/blender/editors/scene/scene_edit.c +++ b/source/blender/editors/scene/scene_edit.c @@ -104,7 +104,11 @@ bool ED_scene_delete(bContext *C, Main *bmain, wmWindow *win, Scene *scene) WM_window_change_active_scene(bmain, C, win, scene_new); BKE_libblock_remap(bmain, scene, scene_new, ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_NEVER_NULL_USAGE); - BKE_libblock_free(bmain, scene); + + id_us_clear_real(&scene->id); + if (scene->id.us == 0) { + BKE_libblock_free(bmain, scene); + } return true; } |