From 09764feaa897fa49a956488c1fb08ce8044675e0 Mon Sep 17 00:00:00 2001 From: chrys Date: Sun, 26 Feb 2017 15:22:41 +0100 Subject: [PATCH] fix releaseDevices --- src/fenrir/inputDriver/evdevDriver.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/fenrir/inputDriver/evdevDriver.py b/src/fenrir/inputDriver/evdevDriver.py index 87a401a0..64bb0416 100644 --- a/src/fenrir/inputDriver/evdevDriver.py +++ b/src/fenrir/inputDriver/evdevDriver.py @@ -215,7 +215,15 @@ class driver(): try: self.uDevices[fd].close() except: - pass + pass + try: + del(self.iDevices[fd]) + except: + pass + try: + del(self.uDevices[fd]) + except: + pass def hasIDevices(self): if not self._initialized: return False @@ -228,7 +236,8 @@ class driver(): def releaseDevices(self): if not self.hasIDevices(): return - for fd in self.iDevices: + devices = self.iDevices.copy() + for fd in devices: self.removeDevice(fd) self.iDevices.clear() self.uDevices.clear()