[Bf-blender-cvs] [7ec5a43] master: Disable node updates while applying links from the dragging operator.

Lukas Tönne noreply at git.blender.org
Fri Dec 4 09:20:22 CET 2015


Commit: 7ec5a4305169a34b69ec8c756364f69b697e7a0b
Author: Lukas Tönne
Date:   Fri Dec 4 09:18:39 2015 +0100
Branches: master
https://developer.blender.org/rB7ec5a4305169a34b69ec8c756364f69b697e7a0b

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.

===================================================================

M	source/blender/editors/space_node/node_relationships.c

===================================================================

diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index f58cfe5..0852b61 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);




More information about the Bf-blender-cvs mailing list