diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-07 19:28:42 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-07 19:28:42 +0400 |
commit | 5455928262c7b2e99c8eb9be13665d819c4089d5 (patch) | |
tree | 3b6d913321ad02f392e55a4983227b1348884671 /source/blender/editors/space_node/node_group.c | |
parent | c31ec62d2f5b33c46d54ddc982c0aed305c56a29 (diff) |
Fix #35122: Blenderplayer crashes when loading level
Issue was caused by ntreeUpdateTree calling for a ntree
which is not in G.main.
This lead to issues in ntreeVerifyNodes (which is called
from ntreeUpdateTree).
Made is so ntreeUpdateTree now accepts main as an argument.
Will work for the release, later we could either solve the
TODO mentioned in ntreeUpdateTree which will eliminate need
in main there or make it so context's main is used from all
over where ntreeUpdateTree is called (currently there're
still some usages of G.main).
Diffstat (limited to 'source/blender/editors/space_node/node_group.c')
-rw-r--r-- | source/blender/editors/space_node/node_group.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c index 64117627be4..9b445cfc82c 100644 --- a/source/blender/editors/space_node/node_group.c +++ b/source/blender/editors/space_node/node_group.c @@ -363,7 +363,7 @@ static int node_group_ungroup_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; if (gnode->id && node_group_ungroup(snode->edittree, gnode)) { - ntreeUpdateTree(snode->nodetree); + ntreeUpdateTree(CTX_data_main(C), snode->nodetree); } else { BKE_report(op->reports, RPT_WARNING, "Cannot ungroup"); @@ -556,7 +556,7 @@ static int node_group_separate_exec(bContext *C, wmOperator *op) /* switch to parent tree */ ED_node_tree_pop(snode); - ntreeUpdateTree(snode->nodetree); + ntreeUpdateTree(CTX_data_main(C), snode->nodetree); snode_notify(C, snode); snode_dag_update(C, snode); @@ -917,6 +917,7 @@ static int node_group_make_exec(bContext *C, wmOperator *op) const char *node_idname = group_node_idname(C); bNodeTree *ngroup; bNode *gnode; + Main *bmain = CTX_data_main(C); ED_preview_kill_jobs(C); @@ -931,11 +932,11 @@ static int node_group_make_exec(bContext *C, wmOperator *op) nodeSetActive(ntree, gnode); if (ngroup) { ED_node_tree_push(snode, ngroup, gnode); - ntreeUpdateTree(ngroup); + ntreeUpdateTree(bmain, ngroup); } } - ntreeUpdateTree(ntree); + ntreeUpdateTree(bmain, ntree); snode_notify(C, snode); snode_dag_update(C, snode); @@ -967,6 +968,7 @@ static int node_group_insert_exec(bContext *C, wmOperator *op) bNodeTree *ngroup; const char *node_idname = group_node_idname(C); bNode *gnode; + Main *bmain = CTX_data_main(C); ED_preview_kill_jobs(C); @@ -983,9 +985,9 @@ static int node_group_insert_exec(bContext *C, wmOperator *op) nodeSetActive(ntree, gnode); ED_node_tree_push(snode, ngroup, gnode); - ntreeUpdateTree(ngroup); + ntreeUpdateTree(bmain, ngroup); - ntreeUpdateTree(ntree); + ntreeUpdateTree(bmain, ntree); snode_notify(C, snode); snode_dag_update(C, snode); |