Improve termination of python processes
Currently, if rsb objects are not properly deactivated, the python process does not terminate correctly, even if
exit is called. This is caused by hanging background threads from the connectors. While it is usually a good habit to properly deactivate rsb objects, this is not always easily in python, as no automatic destruction mechanism exists. Especially in the case of an exception it is hard to correctly tear down remaining rsb objects bevor passing the exception to the python runtime again for program termination. We should somehow find a way of improving this situation so that processes don't always hang around dangling without clear indication why.
#2 Updated by J. Wienke almost 8 years ago
Yes, that's true, but this pattern cannot be applied generally. It's hard to use this throughout more complex hierarchies and behind conventional interfaces.
One thing I could think of is registering all rsb objects in a central list that can be iterated in error handling code for destruction. IS it possible to have a try-finally statement inside a module? Then, inside the finally, that list could be cleared.