summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpython2/pyinotify.py5
-rwxr-xr-xpython3/pyinotify.py5
2 files changed, 10 insertions, 0 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py
index 7733337..707c8e3 100755
--- a/python2/pyinotify.py
+++ b/python2/pyinotify.py
@@ -1447,6 +1447,7 @@ class Notifier:
"""
self._pollobj.unregister(self._fd)
os.close(self._fd)
+ self._sys_proc_fun = None
class ThreadedNotifier(threading.Thread, Notifier):
@@ -1593,6 +1594,10 @@ class TornadoAsyncNotifier(Notifier):
threshold, timeout)
ioloop.add_handler(self._fd, self.handle_read, ioloop.READ)
+ def stop(self):
+ self.io_loop.remove_handler(self._fd)
+ Notifier.stop(self)
+
def handle_read(self, *args, **kwargs):
"""
See comment in AsyncNotifier.
diff --git a/python3/pyinotify.py b/python3/pyinotify.py
index 57c3549..f604385 100755
--- a/python3/pyinotify.py
+++ b/python3/pyinotify.py
@@ -1437,6 +1437,7 @@ class Notifier:
"""
self._pollobj.unregister(self._fd)
os.close(self._fd)
+ self._sys_proc_fun = None
class ThreadedNotifier(threading.Thread, Notifier):
@@ -1583,6 +1584,10 @@ class TornadoAsyncNotifier(Notifier):
threshold, timeout)
ioloop.add_handler(self._fd, self.handle_read, ioloop.READ)
+ def stop(self):
+ self.io_loop.remove_handler(self._fd)
+ Notifier.stop(self)
+
def handle_read(self, *args, **kwargs):
"""
See comment in AsyncNotifier.