From 23edc5eaa71292c3ac398d0f95ceb71353955aa4 Mon Sep 17 00:00:00 2001 From: Chrys Date: Fri, 4 Oct 2019 17:10:58 +0200 Subject: [PATCH] remove devices we cannot read anymore --- src/fenrirscreenreader/inputDriver/evdevDriver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fenrirscreenreader/inputDriver/evdevDriver.py b/src/fenrirscreenreader/inputDriver/evdevDriver.py index 371c7036..e095a59f 100644 --- a/src/fenrirscreenreader/inputDriver/evdevDriver.py +++ b/src/fenrirscreenreader/inputDriver/evdevDriver.py @@ -333,6 +333,7 @@ class driver(inputDriver): self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: grab device ('+ str(self.iDevices[fd].name) + ')',debug.debugLevel.INFO) except IOError: self.gDevices[fd] = True + self.removeDevice(fd) except Exception as e: self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: grabing not possible: ' + str(e),debug.debugLevel.ERROR) return False @@ -346,6 +347,7 @@ class driver(inputDriver): self.env['runtime']['debug'].writeDebugOut('InputDriver evdev: ungrab device ('+ str(self.iDevices[fd].name) + ')',debug.debugLevel.INFO) except IOError: self.gDevices[fd] = False + self.removeDevice(fd) except Exception as e: return False return True