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
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-01-08 19:36:43 +0300
committerJacques Lucke <jacques@blender.org>2022-01-08 19:36:59 +0300
commitd5e73fa13dd275fb9c76b1e41142ab086dd2e6be (patch)
treec9af5d8f8b90bbdbdd032c2232b05cf80db6461f
parent937aa8e1142300e0ba82f6f9b9ddb9908be54b9c (diff)
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).
-rw-r--r--source/blender/blenkernel/intern/node.cc8
1 files changed, 8 insertions, 0 deletions
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);