[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31821] trunk/blender/source/blender/ editors/space_outliner/outliner.c: bugfix [#23720] Performing an object operation in the Outliner in Visible Layers display mode causes CTD

Campbell Barton ideasman42 at gmail.com
Wed Sep 8 05:34:58 CEST 2010


Revision: 31821
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31821
Author:   campbellbarton
Date:     2010-09-08 05:34:45 +0200 (Wed, 08 Sep 2010)

Log Message:
-----------
bugfix [#23720] Performing an object operation in the Outliner in Visible Layers display mode causes CTD

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

Modified: trunk/blender/source/blender/editors/space_outliner/outliner.c
===================================================================
--- trunk/blender/source/blender/editors/space_outliner/outliner.c	2010-09-08 03:13:19 UTC (rev 31820)
+++ trunk/blender/source/blender/editors/space_outliner/outliner.c	2010-09-08 03:34:45 UTC (rev 31821)
@@ -3220,7 +3220,7 @@
 	}
 }
 
-static void outliner_do_object_operation(bContext *C, Scene *scene, SpaceOops *soops, ListBase *lb, 
+static void outliner_do_object_operation(bContext *C, Scene *scene_act, SpaceOops *soops, ListBase *lb, 
 										 void (*operation_cb)(bContext *C, Scene *scene, TreeElement *, TreeStoreElem *, TreeStoreElem *))
 {
 	TreeElement *te;
@@ -3231,16 +3231,18 @@
 		if(tselem->flag & TSE_SELECTED) {
 			if(tselem->type==0 && te->idcode==ID_OB) {
 				// when objects selected in other scenes... dunno if that should be allowed
-				Scene *sce= (Scene *)outliner_search_back(soops, te, ID_SCE);
-				if(sce && scene != sce) {
-					ED_screen_set_scene(C, sce);
+				Scene *scene_owner= (Scene *)outliner_search_back(soops, te, ID_SCE);
+				if(scene_owner && scene_act != scene_owner) {
+					ED_screen_set_scene(C, scene_owner);
 				}
-				/* important to use 'sce' not scene else deleting objects can crash */
-				operation_cb(C, sce, te, NULL, tselem);
+				/* important to use 'scene_owner' not scene_act else deleting objects can crash.
+				 * only use 'scene_act' when 'scene_owner' is NULL, which can happen when the
+				 * outliner isnt showing scenes: Visible Layer draw mode for eg. */
+				operation_cb(C, scene_owner ? scene_owner : scene_act, te, NULL, tselem);
 			}
 		}
 		if((tselem->flag & TSE_CLOSED)==0) {
-			outliner_do_object_operation(C, scene, soops, &te->subtree, operation_cb);
+			outliner_do_object_operation(C, scene_act, soops, &te->subtree, operation_cb);
 		}
 	}
 }





More information about the Bf-blender-cvs mailing list