Closed xielock closed 11 months ago
Good catch. Thanks. Anything related to attaching and detaching in the node graph get's finicky and needs to be handled with care, but I think your explanation and code change seems logical. Fortunately the section of code your change is referencing does not have any particularly annoying lock-free thread-safety issues because the node's outputs are detached from the graph at an earlier stage so I can't see an immediate reason not to get this merged. I will give this a test as soon as I get a chance and report back.
Thank you for your positive feedback and for considering merging my code change. I'll patiently await the results of your testing.
This seems to work fine in my testing. I've gone ahead and merged that into the dev branch.
In function
ma_node_detach_full(...)
, when we want to detach InputBus of one node, we iteratepInputBus->head
. However, when we callma_node_detach_output_bus(...)
->ma_node_input_bus_detach__no_output_bus_lock(...)
in this funciton, we set&pOutputBus->pNext
be NULL, which means we never step into the second iteration and we can't detach all pInputBus of the node. Becausema_node_input_bus_detach__no_output_bus_lock(...)
already set the&pOldPrev
's pNext bepOldNext
, so I think when we iterate InputBus can usepInputBus->head.pNext
instead.