From 4358a9e1b5707b48aa601c9bf3658c9b175b84f9 Mon Sep 17 00:00:00 2001 From: Jim Fulton <jim@zope.com> Date: Fri, 18 Dec 2009 19:54:37 +0000 Subject: [PATCH] Fixed a unix file descriptor leak. --- src/ZEO/zrpc/trigger.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ZEO/zrpc/trigger.py b/src/ZEO/zrpc/trigger.py index 7c94a916..4cce6f9f 100644 --- a/src/ZEO/zrpc/trigger.py +++ b/src/ZEO/zrpc/trigger.py @@ -137,13 +137,15 @@ if os.name == 'posix': def __init__(self, map=None): _triggerbase.__init__(self) - r, self.trigger = self._fds = os.pipe() + r, self.trigger = os.pipe() asyncore.file_dispatcher.__init__(self, r, map) + # file_dispatcher dups r, so we don't need it any more + os.close(r) + def _close(self): - for fd in self._fds: - os.close(fd) - self._fds = [] + os.close(self.trigger) + asyncore.file_dispatcher.close(self) def _physical_pull(self): os.write(self.trigger, 'x') -- 2.30.9