When having loops in a kinematic chain and also a IK constrain, the solve_cycle function removes graph relations necessary to ensure the cleanup operation was running at the very end. Due to his Blender was crashing when some operations (the bone constraints) accessed a pointer that was already freed. Solved by adding more relations between crucial nodes.