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:
parent
94cb282c77
commit
25b14b568a
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue