thedmd / imgui-node-editor

Node Editor built using Dear ImGui
MIT License
3.48k stars 527 forks source link

Circular Reference in Node Pins Causes Hang #262

Open Sage-of-Mirrors opened 8 months ago

Sage-of-Mirrors commented 8 months ago

Hello,

I have created a system whereby a set of nodes are loaded from a JSON file into the nodegraph. The majority of the time this is fine, but every so often I encounter a hang caused by an infinite loop in this for statement. This loop is caused by a pin having a reference to itself in its m_PreviousPin member. I have patched it by adding if (pin == pin->m_PreviousPin) break; to the end of the body, but I am curious if the cause of this circular reference is known? I have been unable to find a cause for it.