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 <i@rong.moe>
This commit is contained in:
Rongrong 2026-06-18 00:25:19 +08:00
parent 94cb282c77
commit 25b14b568a
No known key found for this signature in database
GPG Key ID: 1C2D45D45AB7FE94
1 changed files with 5 additions and 0 deletions

View File

@ -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)