Commit: d5e73fa13dd275fb9c76b1e41142ab086dd2e6be
Author: Jacques Lucke
Date: Sat Jan 8 17:36:43 2022 +0100
Branches: master
https://developer.blender.org/rBd5e73fa13dd275fb9c76b1e41142ab086dd2e6be
Fix T94534: dangling pointer in internal link after removing socket
The dangling pointer caused errors further down the line.
The solution is to simply delete an internal link when one
of the corresponding sockets is removed (just like normal
links are removed as well).
===================================================================
M source/blender/blenkernel/intern/node.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/node.cc
b/source/blender/blenkernel/intern/node.cc
index bd199cff485..51fc7b99fce 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -1947,6 +1947,14 @@ void nodeRemoveSocketEx(struct bNodeTree *ntree,
}
}
+ LISTBASE_FOREACH_MUTABLE (bNodeLink *, link, &node->internal_links) {
+ if (link->fromsock == sock || link->tosock == sock) {
+ BLI_remlink(&node->internal_links, link);
+ MEM_freeN(link);
+ BKE_ntree_update_tag_node_internal_link(ntree, node);
+ }
+ }
+
/* this is fast, this way we don't need an in_out argument */
BLI_remlink(&node->inputs, sock);
BLI_remlink(&node->outputs, sock);
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs