diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-12-04 11:18:39 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-12-04 11:20:08 +0300 |
commit | 7ec5a4305169a34b69ec8c756364f69b697e7a0b (patch) | |
tree | 7b8ddbbb480c92651e8bfb6127a017d27f25be99 /source/blender/editors/space_node/node_relationships.c | |
parent | a9a02490ce7143a94d31c3cd7f6fda480c4fe3ab (diff) |
Disable node updates while applying links from the dragging operator.
This prevents issues with reentrant update callbacks and modification
of the node tree while the operator still holds pointers to it.
Diffstat (limited to 'source/blender/editors/space_node/node_relationships.c')
-rw-r--r-- | source/blender/editors/space_node/node_relationships.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c index f58cfe55f34..0852b6164d3 100644 --- a/source/blender/editors/space_node/node_relationships.c +++ b/source/blender/editors/space_node/node_relationships.c @@ -469,6 +469,8 @@ static void node_link_exit(bContext *C, wmOperator *op, bool apply_links) bNodeLinkDrag *nldrag = op->customdata; LinkData *linkdata; + /* avoid updates while applying links */ + ntree->is_updating = true; for (linkdata = nldrag->links.first; linkdata; linkdata = linkdata->next) { bNodeLink *link = linkdata->data; @@ -495,6 +497,7 @@ static void node_link_exit(bContext *C, wmOperator *op, bool apply_links) else nodeRemLink(ntree, link); } + ntree->is_updating = false; ntreeUpdateTree(CTX_data_main(C), ntree); snode_notify(C, snode); |