Solaar/lib
Ken Sanislo 012d7fd04d Fix crash on exit from device cleanup during interpreter shutdown
`solaar show` (and any exit path) printed a cascade of "I/O operation
on closed file" / "sys.meta_path is None" logging errors at the bottom.

Two compounding causes:

- Device.close() was not idempotent. The CLI closes devices explicitly,
  then __del__ calls close() again during interpreter shutdown, re-running
  every device cleanup a second time. Guard with a _closed flag (not
  self.handle, which is legitimately None for receiver-paired devices).

- rgb_power.cleanup() read device.settings — the lazy property — which
  forces a first-time settings build. Running that build during shutdown
  fails because gettext can no longer import (sys.meta_path is None),
  raising inside a __del__ handler. Read the already-built settings (or
  the persister) via a new _rgb_control_off() helper that never triggers
  the build.

Either guard alone stops the crash; both are correct hardening for a
__del__-invoked path.
2026-07-16 23:03:24 -07:00
..
hid_parser Fix duplicate class field typo in HID parser data 2026-05-05 14:43:03 -04:00
hidapi G522 LIGHTSPEED headphones support 2026-05-21 10:13:00 -04:00
keysyms keysymdef: Rename key symbols 2024-10-11 07:42:38 -04:00
logitech_receiver Fix crash on exit from device cleanup during interpreter shutdown 2026-07-16 23:03:24 -07:00
solaar cli: close devices before shutdown in show 2026-07-02 09:22:32 -04:00