nenolod's fix for overzealous garbage collection.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 27 Sep 2012 15:37:06 +0000 (11:37 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 27 Sep 2012 15:37:06 +0000 (11:37 -0400)
irker

diff --git a/irker b/irker
index cdd247be545bb5d764328b753108d7e5ad146a9d..f3167f665a701c7e980538633f6ecc401c6bf0a6 100755 (executable)
--- a/irker
+++ b/irker
@@ -220,9 +220,9 @@ class Dispatcher:
         self.connections = []
     def dispatch(self, channel, message):
         "Dispatch messages for our server-port combination."
-        self.connections = [x for x in self.connections if x.live()]
-        eligibles = [x for x in self.connections if x.joined_to(channel)] \
-                    or [x for x in self.connections if x.accepting(channel)]
+        connections = [x for x in self.connections if x.live()]
+        eligibles = [x for x in connections if x.joined_to(channel)] \
+                    or [x for x in connections if x.accepting(channel)]
         if not eligibles:
             newconn = Connection(self.irker,
                                  self.servername,
@@ -234,7 +234,7 @@ class Dispatcher:
     def live(self):
         "Does this server-port combination have any live connections?"
         self.connections = [x for x in self.connections if x.live()]
-        return not self.connections
+        return len(self.connections) > 0
 
 class Irker:
     "Persistent IRC multiplexer."