[Bf-blender-cvs] [c7cf8282a6a] master: Fix T62076: Delete Active Scene Freezes Blender.

Bastien Montagne noreply at git.blender.org
Sun Mar 3 22:02:49 CET 2019


Commit: c7cf8282a6ab9b9a627645564d19a8080edd2d09
Author: Bastien Montagne
Date:   Sun Mar 3 21:59:28 2019 +0100
Branches: master
https://developer.blender.org/rBc7cf8282a6ab9b9a627645564d19a8080edd2d09

Fix T62076: Delete Active Scene Freezes Blender.

Not sure where that piece of code originates from, but trying to remap
usages of deleted scene to newly active scene in *whole* bmain is
really, really not the thing to do! Just use generic ID deletion code
here, no reason it could not handle the task properly. ;)

===================================================================

M	source/blender/editors/scene/scene_edit.c

===================================================================

diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c
index b226af46757..8983438f0a3 100644
--- a/source/blender/editors/scene/scene_edit.c
+++ b/source/blender/editors/scene/scene_edit.c
@@ -107,12 +107,7 @@ bool ED_scene_delete(bContext *C, Main *bmain, wmWindow *win, Scene *scene)
 
 	WM_window_set_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);
-
-	id_us_clear_real(&scene->id);
-	if (scene->id.us == 0) {
-		BKE_id_free(bmain, scene);
-	}
+	BKE_id_delete(bmain, scene);
 
 	return true;
 }



More information about the Bf-blender-cvs mailing list