Safety catch to prevent a possible exception at dying time.

This commit is contained in:
Jeremy Fincher 2004-02-06 09:16:40 +00:00
parent 0784ad7246
commit ea2f71d527
2 changed files with 8 additions and 2 deletions

View File

@ -243,7 +243,10 @@ class ChannelStats(callbacks.Privmsg):
world.flushers.append(self.db.flush) world.flushers.append(self.db.flush)
def die(self): def die(self):
world.flushers.remove(self.db.flush) if self.db.flush in world.flushers:
world.flushers.remove(self.db.flush)
else:
self.log.debug('Odd, no flush in flushers: %r', world.flushers)
self.db.close() self.db.close()
callbacks.Privmsg.die(self) callbacks.Privmsg.die(self)

View File

@ -111,7 +111,10 @@ class Seen(callbacks.Privmsg):
callbacks.Privmsg.__init__(self) callbacks.Privmsg.__init__(self)
def die(self): def die(self):
world.flushers.remove(self.db.flush) if self.db.flush in world.flushers:
world.flushers.remove(self.db.flush)
else:
self.log.debug('Odd, no flush in flushers: %r', world.flushers)
self.db.close() self.db.close()
callbacks.Privmsg.die(self) callbacks.Privmsg.die(self)