1 parent 18dd456 commit 758e4eaCopy full SHA for 758e4ea
2 files changed
doc/changelog.rst
@@ -5,8 +5,10 @@ Development
5
^^^^^^^^^^^
6
7
Enhancements:
8
- - Reworked documentation and docstrings.
+ - Rework documentation and docstrings.
9
10
+Fixes:
11
+ - Call ``InputDevice.close()`` in ``InputDevice.__del__()``.
12
13
0.4.1 (Jul 24, 2013)
14
^^^^^^^^^^^^^^^^^^^^
evdev/device.py
@@ -110,6 +110,10 @@ def __init__(self, dev):
110
#: The raw dictionary of device capabilities - see `:func:capabilities()`.
111
self._rawcapabilities = _input.ioctl_capabilities(self.fd)
112
113
+ def __del__(self):
114
+ if hasattr(self, 'fd') and self.fd != None:
115
+ self.close()
116
+
117
def _capabilities(self, absinfo=True):
118
res = {}
119
for etype, ecodes in self._rawcapabilities.items():
0 commit comments