Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorLukas Tönne <lukas.toenne@gmail.com>2013-11-15 19:54:05 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2013-11-15 19:54:05 +0400
commit53fffbafbef694a2378fbf605cc25259a3154f37 (patch)
tree7030f421e66d5bc2c1be7ef77ed635f30c3193ed /source
parent9a78cda32111be9e1c9e2b9c158b27334d3c8804 (diff)
Fix for own mistake in r61178: bNodeTree->links ListBase was being modified while iterating ...
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_node/node_relationships.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index 9f5e8a6f9d9..b50066560fb 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -401,22 +401,27 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeLink *link)
bNodeSocket *from = link->fromsock, *to = link->tosock;
int max_from = from->limit, max_to = to->limit;
int count_from = 1, count_to = 1; /* start at 1, link is included */
- bNodeLink *tlink;
+ bNodeLink *tlink, *tlink_next;
- for (tlink = ntree->links.first; tlink; tlink = tlink->next) {
+ for (tlink = ntree->links.first; tlink; tlink = tlink_next) {
+ tlink_next = tlink->next;
if (tlink == link)
continue;
- if (tlink->fromsock == from) {
+ if (tlink && tlink->fromsock == from) {
++count_from;
- if (count_from > max_from)
+ if (count_from > max_from) {
nodeRemLink(ntree, tlink);
+ tlink = NULL;
+ }
}
- if (tlink->tosock == to) {
+ if (tlink && tlink->tosock == to) {
++count_to;
- if (count_to > max_to)
+ if (count_to > max_to) {
nodeRemLink(ntree, tlink);
+ tlink = NULL;
+ }
}
}
}