SVN: ZODB/trunk/src/ZEO/zrpc/trigger.py Fixed a unix file descriptor leak.

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <[email protected]>
Log message for revision 106766:
  Fixed a unix file descriptor leak.
  

Changed:
  U   ZODB/trunk/src/ZEO/zrpc/trigger.py

-=-
Modified: ZODB/trunk/src/ZEO/zrpc/trigger.py
===================================================================
--- ZODB/trunk/src/ZEO/zrpc/trigger.py	2009-12-18 19:54:35 UTC (rev 106765)
+++ ZODB/trunk/src/ZEO/zrpc/trigger.py	2009-12-18 19:54:37 UTC (rev 106766)
@@ -137,13 +137,15 @@
 
         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')
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.