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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user