[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42141] trunk/blender/source/blender/ editors/space_outliner/outliner_tools.c: Fix #29371: crash deleting objects in outliner.

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Nov 24 21:24:09 CET 2011


Revision: 42141
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42141
Author:   blendix
Date:     2011-11-24 20:24:03 +0000 (Thu, 24 Nov 2011)
Log Message:
-----------
Fix #29371: crash deleting objects in outliner. This was introduced in the
bugfix for #28467, it deleted outliner tree while still traversing it.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_outliner/outliner_tools.c

Modified: trunk/blender/source/blender/editors/space_outliner/outliner_tools.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner_tools.c	2011-11-24 20:01:45 UTC (rev 42140)
+++ trunk/blender/source/blender/editors/space_outliner/outliner_tools.c	2011-11-24 20:24:03 UTC (rev 42141)
@@ -297,8 +297,6 @@
 	if(base==NULL) 
 		base= object_in_scene((Object *)tselem->id, scene);
 	if(base) {
-		SpaceOops *soops= CTX_wm_space_outliner(C);
-
 		// check also library later
 		if(scene->obedit==base->object) 
 			ED_object_exit_editmode(C, EM_FREEDATA|EM_FREEUNDO|EM_WAITCURSOR|EM_DO_UNDO);
@@ -306,15 +304,7 @@
 		ED_base_object_free_and_unlink(CTX_data_main(C), scene, base);
 		te->directdata= NULL;
 		tselem->id= NULL;
-
-		/* XXX: tree management normally happens from draw_outliner(), but when
-		        you're clicking to fast on Delete object from context menu in
-		        outliner several mouse events can be handled in one cycle without
-		        handling notifiers/redraw which leads to deleting the same object twice.
-		        cleanup tree here to prevent such cases. */
-		outliner_cleanup_tree(soops);
 	}
-
 }
 
 static void id_local_cb(bContext *UNUSED(C), Scene *UNUSED(scene), TreeElement *UNUSED(te), TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem)
@@ -579,6 +569,14 @@
 	}
 	else if(event==4) {
 		outliner_do_object_operation(C, scene, soops, &soops->tree, object_delete_cb);
+
+		/* XXX: tree management normally happens from draw_outliner(), but when
+		        you're clicking to fast on Delete object from context menu in
+		        outliner several mouse events can be handled in one cycle without
+		        handling notifiers/redraw which leads to deleting the same object twice.
+		        cleanup tree here to prevent such cases. */
+		outliner_cleanup_tree(soops);
+
 		DAG_scene_sort(bmain, scene);
 		str= "Delete Objects";
 		WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene);




More information about the Bf-blender-cvs mailing list