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...).
This commit is contained in:
Bastien Montagne 2017-10-12 16:50:53 +02:00
parent 557dc7d343
commit e416f417e0
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}