-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Milestone
Description
Currently, the program does not have a clean shutdown process. When the program exits—which at the moment can only happen due to an exception, e.g. an unhandled exception raised by the code or a termination signal—it can leave resources open.
This happens currently in https://github.com/astroplant/astroplant-peripheral-device-library, where some peripherals open PiGPIO I2C handles, which should be explicitly closed on exit, which they now are not.
There are multiple solutions for this. For example, an explicit shutdown process could be implemented, or peripheral devices could be implemented as/using context managers (though this would likely strongly tie the cleanup procedure to the lexical scope).