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_add.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_add.c')
-rw-r--r-- | source/blender/editors/space_node/node_add.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c index 0425ec58f83..61fbde32f7a 100644 --- a/source/blender/editors/space_node/node_add.c +++ b/source/blender/editors/space_node/node_add.c @@ -93,7 +93,7 @@ bNode *node_add_node(const bContext *C, const char *idname, int type, float locx node->locx = locx; node->locy = locy + 60.0f; - ntreeUpdateTree(snode->edittree); + ntreeUpdateTree(bmain, snode->edittree); ED_node_set_active(bmain, snode->edittree, node); if (snode->nodetree->type == NTREE_COMPOSIT) { @@ -285,7 +285,7 @@ static int add_reroute_exec(bContext *C, wmOperator *op) BLI_freelistN(&input_links); /* always last */ - ntreeUpdateTree(ntree); + ntreeUpdateTree(CTX_data_main(C), ntree); snode_notify(C, snode); snode_dag_update(C, snode); |