Do you have any threads which are waiting for interrupts? You can use the InterruptWake() functions to help prep for the Delete() section of the code. I’d also shutdown the network first.
We spawn one thread per axis, and my app doesn’t (currently) have any notion of a defunct axis, so it does it for the two “non-axes” of the second multi-axis drive. The interrupt threads loop, waiting with timeout values, and they check for an “abort” signal before waiting again. Each axis wrapper is supposed to stop its threads in its destructor, some time before the MotionController object gets ::Destroy()ed, but this is running on a customer machine where I cannot easily attach with a debugger to investigate.