rokups / ImNodes

Node graph implementation for Dear ImGui. Used in https://github.com/rokups/rbfx
MIT License
656 stars 57 forks source link

Correct connection deletion order for multiple in/out situations. #13

Closed aaronvark closed 4 years ago

aaronvark commented 4 years ago

Connecting two nodes to a single input creates a problem when deleting the input node, leaving a dangling connection. This is a valid situation in our use-case:

Screenshot 2019-10-09 at 14 55 53
rokups commented 4 years ago

Thanks! Did you observe any cases where it breaks if you only had

((MyNode*) connection.output_node)->DeleteConnection(connection);
((MyNode*) connection.input_node)->DeleteConnection(connection);

?

aaronvark commented 4 years ago

I tried with the above code, and the reverse situation in this case (Pulse to 2 Logs) causes a nullref when deleting one of the LogNodes.