Fixed bug #22518, Segfault on loading file
authorNicholas Bishop <nicholasbishop@gmail.com>
Mon, 7 Jun 2010 02:42:26 +0000 (02:42 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Mon, 7 Jun 2010 02:42:26 +0000 (02:42 +0000)
* Problem was a pointer not being updated after the tree was changed

source/blender/editors/space_outliner/outliner.c

index 21da637fd7c9f2aa6d44a956acaef3b9a796a11b..37e05cbc682513fc6d79fc3ace98fc62d05bc91f 100644 (file)
@@ -439,8 +439,8 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
 
 static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, SceneRenderLayer *srl)
 {
-       TreeStoreElem *tselem= TREESTORE(tenla);
-       TreeElement *te;
+       TreeStoreElem *tselem = NULL;
+       TreeElement *te = NULL;
 
        /* log stuff is to convert bitflags (powers of 2) to small integers,
         * in order to not overflow short tselem->nr */
@@ -450,6 +450,7 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc
        te->directdata= &srl->passflag;
        
        /* save cpu cycles, but we add the first to invoke an open/close triangle */
+       tselem = TREESTORE(tenla);
        if(tselem->flag & TSE_CLOSED)
                return;