From 25b14b568a33da29d45b089f98d6604615c2216d Mon Sep 17 00:00:00 2001 From: Rongrong Date: Thu, 18 Jun 2026 00:25:19 +0800 Subject: [PATCH] rules: uinput: Fix device leakage While randomly messing around with rule components (I plan to add some new ones), I found this bug by screwing things up (shh...) Signed-off-by: Rongrong --- lib/logitech_receiver/diversion.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/logitech_receiver/diversion.py b/lib/logitech_receiver/diversion.py index 670fd739..4732512e 100644 --- a/lib/logitech_receiver/diversion.py +++ b/lib/logitech_receiver/diversion.py @@ -330,6 +330,11 @@ def simulate_uinput(what, code, arg): logger.debug("uinput simulated input %s %s %s", what, code, arg) return True except Exception as e: + try: + udevice.close() + except Exception: + pass + udevice = None logger.warning("uinput write failed: %s", e)