diff options
author | Sébastien Martini <seb@dbzteam.org> | 2014-12-22 16:58:34 +0100 |
---|---|---|
committer | Sébastien Martini <seb@dbzteam.org> | 2014-12-22 16:58:34 +0100 |
commit | 799285ef35036f193c953e4c0b47cc1d97c2934f (patch) | |
tree | 33f2445c1aa15787e886739400074af654a1a82c | |
parent | af50b62ae18605a95cfe659b62133be411794666 (diff) | |
parent | 5b8699693956fec9693330613592aa5f87892511 (diff) | |
download | pyinotify-799285ef35036f193c953e4c0b47cc1d97c2934f.tar.gz |
Merge pull request #88 from apenwarr/master
Allow TornadoAsyncNotifier.stop() to clean up all hanging refs.
-rwxr-xr-x | python2/pyinotify.py | 5 | ||||
-rwxr-xr-x | python3/pyinotify.py | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py index 83f7766..13af04e 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 a6601c8..4f039f5 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. |