diff options
author | Jacques Lucke <jacques@blender.org> | 2021-03-15 17:41:41 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-03-15 17:41:41 +0300 |
commit | cf5cada6b23d5b3670c1d321b2a566c5571941c0 (patch) | |
tree | 7c08a077ad5884d056f3d6f3988051196a0cb14c /source/blender/editors/space_node/node_relationships.c | |
parent | 3618948df85f18f6ab5d33e10139520b4c3dd092 (diff) |
Nodes: fix crash after undo after recent multi-input-socket changes
The issue is that the `last_node_hovered_while_dragging_a_link` pointer is invalidated on undo.
The pointer does not have to be on the space runtime data, because it only needs to exist
as long as the operator is running.
Differential Revision: https://developer.blender.org/D10726
Diffstat (limited to 'source/blender/editors/space_node/node_relationships.c')
-rw-r--r-- | source/blender/editors/space_node/node_relationships.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c index 9293494a16a..ee07ec7a55c 100644 --- a/source/blender/editors/space_node/node_relationships.c +++ b/source/blender/editors/space_node/node_relationships.c @@ -902,7 +902,7 @@ static void node_link_find_socket(bContext *C, wmOperator *op, float cursor[2]) /* attach links to the socket */ link->tonode = tnode; link->tosock = tsock; - snode->runtime->last_node_hovered_while_dragging_a_link = tnode; + nldrag->last_node_hovered_while_dragging_a_link = tnode; if (existing_link_connected_to_fromsock) { link->multi_input_socket_index = existing_link_connected_to_fromsock->multi_input_socket_index; @@ -914,9 +914,9 @@ static void node_link_find_socket(bContext *C, wmOperator *op, float cursor[2]) else { LISTBASE_FOREACH (LinkData *, linkdata, &nldrag->links) { bNodeLink *link = linkdata->data; - if (snode->runtime->last_node_hovered_while_dragging_a_link) { + if (nldrag->last_node_hovered_while_dragging_a_link) { sort_multi_input_socket_links( - snode, snode->runtime->last_node_hovered_while_dragging_a_link, NULL, cursor); + snode, nldrag->last_node_hovered_while_dragging_a_link, NULL, cursor); } link->tonode = NULL; link->tosock = NULL; |